Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.
What Is This Strategy?
The Stochastic Momentum Index Reversal is a counter-trend, mean-reversion swing system built around William Blau's Stochastic Momentum Index (SMI) — a refined, zero-centred relative of the classic stochastic oscillator. Where an ordinary stochastic asks "where does price sit inside its recent range, on a 0–100 scale?", the SMI asks a sharper question: "how far is the close from the centre of the recent range, after double smoothing?" It reports the answer as a value that swings roughly between −100 and +100. Because the reading is centred on zero and smoothed twice, the SMI is far less jittery than a raw stochastic, so its extreme readings tend to be more trustworthy as potential turning points.
This strategy is designed for range-bound and mean-reverting conditions rather than strong, one-directional trends. It looks for moments when momentum has become stretched to an extreme and then shows the first genuine sign of rolling over. In plain terms, it tries to fade — trade against — an over-extended move, but only after that move appears to be losing steam. That "wait for confirmation" design is deliberate: fading extremes blindly is one of the most common ways traders get run over.
As a learning tool, this EA (Expert Advisor — an automated trading program for MetaTrader 5) is a clear, self-contained example of how to combine an oscillator extreme with a signal-line crossover and volatility-scaled risk. It is best suited to students of technical analysis who want to study how mean-reversion logic is structured in code, how double smoothing changes an indicator's behaviour, and how ATR-based stops keep risk consistent across symbols and timeframes. It is not a shortcut to results — it is a framework for understanding a specific, well-defined trading idea.
How It Works
The strategy processes each newly closed bar (it never acts on the still-forming candle) and rebuilds the SMI incrementally. Here is what happens under the hood and how the signals are formed:
- Building the SMI. Over the last
SmiLengthclosed bars, the strategy finds the highest High (HH) and lowest Low (LL). It computes the range centre as(HH + LL) / 2and the range itself asHH − LL. The signed distance of the close from that centre (M = Close − centre) and the range (D) are each double-smoothed with two successive EMAs (exponential moving averages) of periodSmoothingPeriod. The SMI is then100 × M2 / (0.5 × D2), producing a reading near +100 when price is pinned to the highs and near −100 when pinned to the lows. - The signal line. A slower EMA of the SMI (period
SignalPeriod) is tracked as a signal line. The strategy watches for the SMI crossing this line — the first observable sign that the double-smoothed momentum has actually turned. - The core filter. The strategy never fades on an extreme reading alone. Two things must line up on the same freshly-closed bar before any trade is considered.
The strategy signals a long (buy) when:
- The SMI is below
−EntryLevel(a deep oversold zone), and - The SMI crosses up through its signal line on that bar — momentum has visibly begun to turn back up from within the extreme.
The strategy signals a short (sell) when:
- The SMI is above
+EntryLevel(a deep overbought zone), and - The SMI crosses down through its signal line on that bar.
The long and short rules are exact mirrors of each other. Demanding a same-bar signal-line turn from inside the extreme zone is the whole point of the design: it screens out open-ended trends, where lone oversold/overbought fades tend to get overrun, and only acts once momentum has rolled over.
Exit, stop-loss, and take-profit logic:
- Risk is volatility-scaled using the ATR (Average True Range) indicator, which measures recent price movement. The stop-loss is placed
AtrStopMult × ATRbeyond the entry price. - The take-profit is set at
RewardRatiotimes the stop distance — so with the defaults, the target sits at 1.6× the risk taken on each trade. - Once a position is open, the fixed stop-loss and take-profit levels manage the exit entirely; there is no separate trailing or time-based exit.
- Only one position per Magic number is allowed at a time, which keeps risk bounded and the fade clean.
- Two additional gates protect execution quality: trades are skipped if the current spread exceeds
MaxSpreadPoints, and enough historical bars must exist for both the SMI window and the ATR calculation before any trade can fire.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| SmiLength | 10 | 5 | 40 | Range lookback (in bars) for the SMI's highest-High / lowest-Low window. |
| SmoothingPeriod | 3 | 2 | 15 | EMA period used for both stages of the double smoothing applied to M and D. |
| SignalPeriod | 3 | 2 | 15 | EMA period of the SMI signal line that the SMI must cross. |
| EntryLevel | 40.0 | 20.0 | 65.0 | The SMI's absolute value must exceed this (an extreme zone) before a fade is allowed. |
| AtrPeriod | 14 | 7 | 30 | ATR period used for volatility-scaled risk sizing. |
| AtrStopMult | 1.5 | 0.5 | 5.0 | Stop-loss distance as this multiple of ATR beyond the entry. |
| RewardRatio | 1.6 | 0.8 | 4.0 | Take-profit distance expressed as a multiple of the stop distance. |
| MaxSpreadPoints | 30 | 1 | 200 | Skip the trade if the current spread (in points) is wider than this. |
| Lots | 0.10 | 0.01 | 1.00 | Order volume (position size) in lots. |
| Magic | 5271 | 0 | 9,999,999 | Magic number used to identify and isolate this EA's positions. |

Recommended Chart Settings
This strategy was designed with a mean-reverting major currency pair (such as EURUSD or AUDUSD) or a metal in mind, on M15 to H1 timeframes, in a swing-trading style. These markets and timeframes tend to produce the kind of stretched-then-rolling-over momentum that the SMI-plus-crossover logic is built to detect.
That said, no single setting is universally optimal. The SMI's behaviour, the frequency of extreme readings, and the effectiveness of ATR-based stops all shift with the instrument and the prevailing market regime. Results will vary considerably across different symbols, timeframes, and conditions, so treat the recommended settings as a starting point for study and testing, not a fixed prescription.
How to Install on MetaTrader 5
- Download the
StochasticMomentumIndexReversal.ex5file from the link below. - Copy it to your MT5
MQL5\Expertsfolder. - Restart MetaTrader 5 or refresh the Navigator panel.
- Drag the EA onto a chart matching the recommended symbol and timeframe.
- Configure the input parameters and enable Algo Trading.
What to Consider Before Using This EA
Like every strategy, this one has clear strengths and equally clear limitations. A balanced view matters more than a hopeful one.
Strengths of this approach:
- The double smoothing of the SMI reduces the whipsaw and noise that plague raw stochastics, making its extreme readings comparatively more meaningful.
- Requiring a signal-line crossover inside the extreme zone is a disciplined confirmation filter. It avoids the classic "catch a falling knife" mistake of fading a strong move purely because an oscillator looks oversold.
- ATR-based, volatility-scaled risk keeps stop and target distances proportional to current market conditions, which helps the logic behave consistently across symbols and timeframes.
- A fixed reward-to-risk ratio and a one-position limit make the risk profile of each trade transparent and bounded.
Known limitations and where it may underperform:
- Mean-reversion systems are structurally vulnerable to strong trends. When a market breaks into a sustained one-directional move, an oscillator can stay pinned in "overbought" or "oversold" far longer than expected, and repeated fade attempts can accumulate losses even with the crossover filter in place.
- The strategy trades against the immediate move, which is psychologically demanding and inherently lower-probability during trending regimes.
- Signal-line crossovers can occur prematurely, triggering an entry before the reversal fully develops.
- Performance is sensitive to parameter choices — the lookback, smoothing, entry level, and ATR multiplier all interact, and a set tuned to one market may behave very differently on another.
- News events, gaps, and periods of widening spreads can undermine any short-term technical system; the spread gate helps but does not eliminate this risk.
The honest takeaway: this is a well-constructed illustration of a mean-reversion concept, useful for learning how such logic is built and behaves — not a guarantee of any particular outcome.
Risk Management Tips
Sound risk management matters far more than any single indicator or entry rule. As you study this strategy, keep these general principles in mind:
- Risk only a small fraction of your account per trade — many educators suggest no more than 1–2%. Size your
Lotsso that a stop-out costs no more than that fraction, rather than trading a fixed lot without regard to account size. - Test on a demo account first. Run the EA on a demo or simulated environment for an extended period before ever considering real capital, so you can observe how it behaves across different conditions.
- Understand drawdown. Even a well-designed strategy experiences losing streaks. Know the maximum drawdown you are willing to tolerate, and recognise that mean-reversion systems can string together losses during trends.
- Diversify and avoid over-leverage. Concentrating risk in one symbol or using excessive leverage magnifies both the ups and the downs.
- Keep expectations grounded. No parameter set removes uncertainty. Treat this EA as a framework for learning about momentum, mean reversion, and risk-scaled position management — not as a solved problem.
Risk Warning
Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.
Downloads
- Expert Advisor: StochasticMomentumIndexReversal.ex5 (36 downloads)
- Source Code: StochasticMomentumIndexReversal.mq5 (33 downloads)
- Documentation: StochasticMomentumIndexReversal.pdf (38 downloads)