OPEN-SOURCE SCRIPT
SOFT Speed & Linearity Strategy (MTF) LIVE & BACKTEST

SOFT Speed × Linearity Strategy (MTF – LIVE & BACKTEST)
This strategy detects clean impulsive moves by combining real-time price speed with directional quality (linearity).
It is designed for intraday markets such as Gold (XAUUSD), Nasdaq, and Crypto (ETH, BTC), where acceleration quality matters more than raw indicators.
🔹 Core Concepts
1️⃣ Speed ($ per second)
Measures how fast price is moving
Expressed in $/second, not points or ticks
Two execution modes:
LIVE → real-time intra-candle speed using elapsed seconds
BACKTEST → historical approximation using (Close − Open) / candle duration
2️⃣ Linearity Score (1 → 5)
Evaluates movement quality inside the candle:
Net progress vs adverse excursion
Identifies one-way impulses vs noisy back-and-forth moves
Interpretation
1–2 → choppy / rotational
3 → acceptable
4–5 → clean impulse (higher continuation probability)
🔹 Visual Panel
Histogram bars = Speed × Linearity
Color reflects directional quality
Optional info label displays:
Execution mode (LIVE / BACKTEST)
Analysis timeframe
Linearity score
Direction
Speed ($/s)
No drawings are placed on candles.
🔹 Entry Logic
Configurable conditions:
Minimum linearity score
Minimum speed
Direction aligned with candle movement
Long / Short / Both modes
Optional cooldown between signals
⚠️ Speed thresholds are separated for LIVE and BACKTEST to reflect their different nature.
🔹 Exit Modes (Selectable)
A — Symmetric
Exit when entry conditions are no longer valid.
B — Hysteresis (default)
Exit only after controlled degradation:
Linearity falls below a lower threshold
Or speed drops below a lower threshold
C — Momentum
Exit when speed no longer supports the trade direction (speed ≤ 0).
Optional add-ons:
Exit on opposite signal
Exit on speed channel re-entry
🔹 Multi-Timeframe (MTF)
Default analysis timeframe: 15 minutes
Optional lock to chart timeframe
Safety rule for public use:
If chart timeframe < 15m, analysis remains on 15m
Prevents misleading ultra-fast recalculations
🔹 LIVE vs BACKTEST (Important)
LIVE mode uses true intra-candle acceleration
BACKTEST mode uses an approximation to allow reproducible historical testing
Results between LIVE and BACKTEST are not identical by design
This is intentional and clearly separated.
🔹 Alerts
Available alerts:
BUY
SELL
EXIT
Speed channel breakout
ALL events
Compatible with TradingView webhooks.
🔹 Intended Use
This is not a trend indicator.
This is not a prediction tool.
It is a momentum quality detector, useful to:
Validate breakouts
Filter false accelerations
Trade continuation, not anticipation
⚠️ Disclaimer
This script is for educational and research purposes only.
It does not constitute financial advice.
Always test, adapt parameters to your market, and manage risk.
This strategy detects clean impulsive moves by combining real-time price speed with directional quality (linearity).
It is designed for intraday markets such as Gold (XAUUSD), Nasdaq, and Crypto (ETH, BTC), where acceleration quality matters more than raw indicators.
🔹 Core Concepts
1️⃣ Speed ($ per second)
Measures how fast price is moving
Expressed in $/second, not points or ticks
Two execution modes:
LIVE → real-time intra-candle speed using elapsed seconds
BACKTEST → historical approximation using (Close − Open) / candle duration
2️⃣ Linearity Score (1 → 5)
Evaluates movement quality inside the candle:
Net progress vs adverse excursion
Identifies one-way impulses vs noisy back-and-forth moves
Interpretation
1–2 → choppy / rotational
3 → acceptable
4–5 → clean impulse (higher continuation probability)
🔹 Visual Panel
Histogram bars = Speed × Linearity
Color reflects directional quality
Optional info label displays:
Execution mode (LIVE / BACKTEST)
Analysis timeframe
Linearity score
Direction
Speed ($/s)
No drawings are placed on candles.
🔹 Entry Logic
Configurable conditions:
Minimum linearity score
Minimum speed
Direction aligned with candle movement
Long / Short / Both modes
Optional cooldown between signals
⚠️ Speed thresholds are separated for LIVE and BACKTEST to reflect their different nature.
🔹 Exit Modes (Selectable)
A — Symmetric
Exit when entry conditions are no longer valid.
B — Hysteresis (default)
Exit only after controlled degradation:
Linearity falls below a lower threshold
Or speed drops below a lower threshold
C — Momentum
Exit when speed no longer supports the trade direction (speed ≤ 0).
Optional add-ons:
Exit on opposite signal
Exit on speed channel re-entry
🔹 Multi-Timeframe (MTF)
Default analysis timeframe: 15 minutes
Optional lock to chart timeframe
Safety rule for public use:
If chart timeframe < 15m, analysis remains on 15m
Prevents misleading ultra-fast recalculations
🔹 LIVE vs BACKTEST (Important)
LIVE mode uses true intra-candle acceleration
BACKTEST mode uses an approximation to allow reproducible historical testing
Results between LIVE and BACKTEST are not identical by design
This is intentional and clearly separated.
🔹 Alerts
Available alerts:
BUY
SELL
EXIT
Speed channel breakout
ALL events
Compatible with TradingView webhooks.
🔹 Intended Use
This is not a trend indicator.
This is not a prediction tool.
It is a momentum quality detector, useful to:
Validate breakouts
Filter false accelerations
Trade continuation, not anticipation
⚠️ Disclaimer
This script is for educational and research purposes only.
It does not constitute financial advice.
Always test, adapt parameters to your market, and manage risk.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。