Momentum Based SMI Crossover Signal Adaptive Prediction Strategy
This strategy is an adaptive trading system based on the Stochastic Momentum Index (SMI). It predicts market trends by analyzing crossovers between the SMI indicator and its signal line, automatically generating buy…

Overview
This strategy is an adaptive trading system based on the Stochastic Momentum Index (SMI). It predicts market trends by analyzing crossovers between the SMI indicator and its signal line, automatically generating buy and sell signals at key positions. The strategy employs double exponential moving averages (EMA) to smooth data and improve signal reliability. This system is particularly suitable for medium to long-term trading and effectively captures major market trend reversal points.
Strategy Principles
The core of the strategy lies in measuring price momentum through the SMI calculation. It first determines the highest and lowest price range within a specific period, then normalizes the closing price's position relative to this range. By applying double EMA smoothing to both the relative range and price range, it generates more stable SMI values. Buy signals are triggered when the SMI line makes a golden cross with its signal line (SMI's EMA), while death crosses trigger sell signals. Overbought and oversold zones (+40/-40) are set to confirm signal reliability.
Strategy Advantages
- Clear Signal Generation: Uses crossover signals as trading triggers, eliminating subjective judgment
- Strong Noise Resistance: Employs double EMA smoothing to effectively filter market noise
- High Adaptability: Can adapt to different market environments through parameter optimization
- Comprehensive Risk Control: Sets overbought/oversold zones to avoid misjudgments in extreme market conditions
- High Visualization: Uses gradient fills to intuitively display market conditions
Strategy Risks
- Lag Risk: Signal generation has some delay due to multiple moving average calculations
- Oscillation Risk: May generate false signals in sideways markets
- Parameter Sensitivity: Different parameter combinations can lead to drastically different results
- Market Environment Dependence: Performs better in trending markets, less effective in ranging markets
Optimization Directions
- Incorporate Volume Indicators: Validate signal effectiveness by combining volume changes
- Add Trend Filters: Confirm overall trend direction using longer-period moving averages
- Optimize Parameter Adaptation: Dynamically adjust parameters based on market volatility
- Enhance Stop Loss Mechanism: Implement trailing stops to protect profits
- Improve Risk Management: Add position sizing and money management modules
Summary
This is a mature trading strategy based on the SMI indicator, generating trading signals through technical indicator crossovers with strong practicality. The strategy's core advantages lie in its clear signals and strong noise resistance, though it does have some inherent lag. Through optimizations such as volume validation and trend filtering, the strategy's stability and reliability can be further enhanced. This strategy is particularly suitable for tracking medium to long-term trends and serves as an excellent choice for investors looking to build systematic trading systems.
Source Pine Script
/*backtest
start: 2024-12-19 00:00:00
end: 2024-12-26 00:00:00
period: 45m
basePeriod: 45m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Iban_Boe
//@version=6
strategy("SMI Strategy with Signals", "SMI Strategy", overlay=false)
// Parámetros del SMI
lengthK = input.int(14, "%K Length", minval=1, maxval=15000)
lengthD = input.int(3, "%D Length", minval=1, maxval=4999)
lengthEMA = input.int(3, "EMA Length", minval=1, maxval=4999)
// Función de doble EMA
emaEma(source, length) => ta.ema(ta.ema(source, length), length)
// Cálculos del SMI
highestHigh = ta.highest(lengthK)
lowestLow = ta.lowest(lengthK)
highestLowestRange = highestHigh - lowestLow
relativeRange = close - (highestHigh + lowestLow) / 2
smi = 200 * (emaEma(relativeRange, lengthD) / emaEma(highestLowestRange, lengthD))
smiSignal = ta.ema(smi, lengthEMA)
// Gráficos del SMI
smiPlot = plot(smi, "SMI", color=color.blue)
plot(smiSignal, "SMI-based EMA", color=color.orange)
// Level lines
hline(40, "Overbought Line", color=color.green)
hline(-40, "Oversold Line", color=color.red)
hline(0, "Middle Line", color=color.gray)
midLinePlot = plot(0, color = na, editable = false, display = display.none)
fill(smiPlot, midLinePlot, 120, 40, top_color = color.new(#4caf4f, 50), bottom_color = color.new(color.green, 100), title = "Overbought Gradient Fill")
fill(smiPlot, midLinePlot, -40, -120, top_color = color.new(color.red, 100), bottom_color = color.new(color.red, 50), title = "Oversold Gradient Fill")
// Señales de compra y venta
buySignal = ta.crossover(smi, smiSignal) // Detect crossover
sellSignal = ta.crossunder(smi, smiSignal) // Detect crossover
// Graficar señales de compra/venta
plotshape(series=buySignal, style=shape.labelup, location=location.belowbar, color=color.green, size=size.tiny, title="Señal de Compra")
plotshape(series=sellSignal, style=shape.labeldown, location=location.abovebar, color=color.red, size=size.tiny, title="Señal de Venta")
// Lógica de la estrategia
if (buySignal)
strategy.entry("Compra", strategy.long)
if (sellSignal)
strategy.entry("Venta", strategy.short)
// Alertas
alertcondition(buySignal, title="Alerta de Compra", message="¡Señal de Compra Detectada!")
alertcondition(sellSignal, title="Alerta de Venta", message="¡Señal de Venta Detectada!")
Published by ChaoZhang on the FMZ strategy square · last modified 2024-12-27. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Momentum-Based-SMI-Crossover-Signal-Adaptive-Prediction-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Advanced Multi Indicator Trend Following and Momentum Quantitative Trading StrategyPine Script · Momentum · 1h
- Ergotic Momentum Direction Convergence Trading StrategyPine Script · Momentum · 1d
- MoonFlag MACD Momentum StochRSI Trading StrategyPine Script · Momentum · 1d
- Multi EMA Trend Momentum Trading Strategy with Risk Management SystemPine Script · Momentum · 1h
- Multi factor Adaptive Momentum Tracking StrategyPine Script · Momentum · 3m
- Stochastic Momentum Index and RSI Based Quant Trading StrategyPine Script · Momentum · 5m