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?
Range Edge Momentum Thrust is a price-action breakout strategy that combines a classic range-breakout filter with a momentum "power bar" test, built for the MetaTrader 5 (MT5) platform. It uses no oscillators or moving-average crossovers. Instead, it watches the recent trading range — the highest high and lowest low of a fixed lookback window — and waits for a single, decisive candle to close beyond that edge with genuine force behind it. The two ingredients it leans on are a range edge (a fresh shelf of support or resistance) and an Average True Range (ATR) reading, which is a standard measure of how much an instrument typically moves over a set number of bars.
The strategy is designed for markets that have been coiling sideways and then release energy in one direction. Ranges form when buyers and sellers are roughly balanced; a real shift in that balance tends to show up as a wide-bodied candle that pushes through one boundary and refuses to wick back. Range Edge Momentum Thrust is built to ignore the weak, indecisive pokes through a level (which are often faded) and to react only when the breakout candle looks like committed, initiative trading.
As a learning tool, this approach suits traders who want to study how breakout and momentum confirmation can be expressed in objective, rule-based code rather than discretionary judgement. It is a useful way to explore concepts such as ATR-based risk sizing, candle-body filtering, and "close location" analysis. It is not a shortcut, and it is best examined first in a backtester and on a demo account, where you can watch how each rule behaves in different conditions.
How It Works
The strategy evaluates its rules once per completed bar — it never acts on a half-formed candle. When a new bar opens, the bar that just closed becomes the "signal bar," and that candle is tested against every condition below.
Entry conditions (long): The strategy signals a long (buy) setup when all of the following are true:
- Range edge cleared: The signal bar's close is above the highest high of the
RangePeriodbars immediately before it. That prior range high acts as a fresh shelf of resistance the candle must clear. - Momentum gate (power bar): The signal bar's body — the absolute distance between its open and close — is at least
BodyAtrMult × ATR. This filters out small, hesitant candles and requires a wide, decisive body relative to recent volatility. - Close location: The candle must close in the upper portion of its own range, measured by
ClosePct(for example, a value of 0.66 means the close sits in the top third of the bar). This helps confirm the thrust held into the close rather than spiking and reversing.
Entry conditions (short): A short (sell) setup is the mirror image — the close is below the lowest low of the prior range, the body still meets the BodyAtrMult × ATR momentum gate, and the close sits near the low of the candle's range (within 1.0 − ClosePct).
Stop-loss logic: Risk is defined by volatility, not a fixed pip count. On a long, the stop-loss is placed SlAtrMult × ATR below the entry price; on a short, it sits the same distance above. Because the distance scales with ATR, the protective stop automatically widens in fast markets and tightens in calm ones.
Take-profit logic: The target is also ATR-based. A long's take-profit is set TpAtrMult × ATR above entry, and a short's is the same distance below. With the default settings (SlAtrMult 1.50 and TpAtrMult 2.50), the intended reward-to-risk ratio is roughly 1.67 to 1.
Position management: The strategy holds only one position per Magic number at a time. While a trade is open it stops looking for new signals, which keeps exposure simple and avoids stacking multiple trades on the same idea. A Magic number is just an identifier MT5 uses so the Expert Advisor (EA) only manages its own orders.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| RangePeriod | 20 | 6 | 60 | Number of completed bars used to define the resistance/support shelf the breakout must clear. |
| AtrPeriod | 14 | 7 | 30 | Lookback length for the ATR, used in both the power-bar test and stop/target sizing. |
| BodyAtrMult | 0.70 | 0.30 | 1.50 | Minimum body size of the breakout bar, expressed in ATR multiples (the momentum gate). |
| ClosePct | 0.66 | 0.50 | 0.95 | How close to the candle's extreme the close must sit (1.0 = exactly at the high/low). |
| SlAtrMult | 1.50 | 0.50 | 4.00 | Protective stop distance, in ATR multiples. |
| TpAtrMult | 2.50 | 0.50 | 6.00 | Profit target distance, in ATR multiples. |
| Lots | 0.10 | 0.01 | 1.00 | Fixed trade size in lots. |

Recommended Chart Settings
The intended — but not locked — home for Range Edge Momentum Thrust is an active FX major such as GBPUSD on the M15 (15-minute) timeframe. That pairing offers reasonable volatility and clean intraday ranges, which suits a breakout-and-thrust concept. Because every price reference in the code uses the chart's own symbol and timeframe, the EA will run on whatever instrument and timeframe you attach it to. Keep in mind that results will vary considerably across different symbols, sessions, and market conditions, and that any parameter set that looks favourable on one instrument may behave very differently on another. Treat the defaults as a starting point for study, not a finished configuration.
How to Install on MetaTrader 5
- Download the
.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
Strengths of the approach. The double filter — a range break and a momentum power bar — is designed to reduce the false signals that plague naive breakout systems, where price pokes a level on a thin candle and immediately reverses. Requiring a wide body and a close near the extreme is a sensible, well-known way to demand confirmation. Tying both the stop and the target to ATR is also a clean form of volatility adaptation, so the strategy does not use one fixed stop size across calm and chaotic markets alike.
Known limitations. Breakout strategies historically struggle in choppy, range-bound conditions, where price repeatedly breaks an edge and then fails — sometimes called a "fakeout." This system can be whipsawed in such environments, taking a power-bar entry that quickly stalls. It also enters after a candle has already made a large move, which means part of the immediate range is behind it and the stop must sit a meaningful distance away. The one-position-at-a-time rule keeps things simple but means the EA may sit out additional opportunities while a trade is live.
Conditions where it may underperform. Low-volatility, tightly compressed markets and news-driven spikes that reverse hard can both produce signals that do not follow through. Wide spreads on exotic pairs or during illiquid sessions can also erode an ATR-based target. None of these make the concept invalid — they simply mark the conditions where careful testing matters most.
Risk Management Tips
Sound risk management matters more than any single entry rule. As a general educational guideline:
- Risk a small, fixed fraction per trade. Many educators suggest never risking more than 1–2% of account equity on any single position. Adjust the
Lotssize so that the distance to your ATR-based stop represents that small percentage, rather than trading a fixed lot blindly. - Understand drawdown. Even a well-constructed strategy will experience losing streaks. Study how deep and how long historical drawdowns ran before committing real capital, and ask whether you could sit through a similar stretch calmly.
- Test on a demo account first. Run the EA on a demo or in the Strategy Tester across multiple market regimes — trending, ranging, volatile, and quiet — before considering any live use.
- Mind costs. Spread, commission, and slippage all reduce real-world outcomes versus an idealized backtest, especially on a 15-minute breakout system that may trade frequently.
- Keep position sizing consistent. Avoid increasing size to "make back" a loss; consistent sizing is part of surviving variance.
By treating Range Edge Momentum Thrust as a structured lesson in breakout filtering, momentum confirmation, and volatility-based risk, you will learn far more than by chasing any single result.
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: RangeEdgeMomentumThrust.ex5 (5 downloads)
- Source Code: RangeEdgeMomentumThrust.mq5 (5 downloads)
- Documentation: RangeEdgeMomentumThrust.pdf (4 downloads)