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 Broadening Range Reversal strategy is a pure price-action, counter-trend mean-reversion system built around the broadening formation — the chart pattern also known as the "megaphone" or expanding-range pattern. Unlike most automated strategies, it uses no indicators at all: no moving averages, no RSI, no ATR. Every decision is derived directly from raw candle highs, lows, and closes. This makes it a clean case study in how structural, geometry-based logic can be encoded into an Expert Advisor (EA) for MetaTrader 5.
A broadening formation is the geometric opposite of a triangle. Instead of price coiling into a tighter and tighter range, the swings fan out: each new swing high prints above the previous swing high, while each new swing low prints below the previous swing low. This structure is a signature of rising emotion and poor two-way commitment. Breakout traders are repeatedly trapped as price overshoots each prior extreme and then snaps back through the middle of the range. The strategy is designed to fade — that is, to trade against — those failed breakouts.
This system is best understood as a learning tool for traders who want to study price structure, swing pivots, and mean-reversion logic. It is suited to those interested in ranging, emotional market conditions rather than smooth trends. If you are exploring how pattern-recognition rules can be automated without a single technical indicator, the Broadening Range Reversal offers a compact, self-contained example. It is not a shortcut to results, and it is presented here strictly for analysis and education.
How It Works
The strategy detects a megaphone pattern in three stages, then acts only when a fresh candle overshoots and rejects one of the expanding rails. All thresholds scale off the average bar range (mean High − Low across the lookback window), so the system self-adapts to each symbol's volatility without any per-symbol point math.
Detecting the pattern:
- Swing pivots: The strategy scans recent bars for fractal swing highs and lows — a pivot high is the strictly highest high compared with a symmetric window of bars on each side (and the mirror for a pivot low). It identifies the two most-recent confirmed swing highs and two most-recent swing lows.
- Expansion gate: A genuine megaphone requires that the newer swing high sits above the older swing high and the newer swing low sits below the older swing low — each by at least
MinExpansion× average bar range. Demanding that both rails diverge filters out ordinary trends (where only one rail expands) and flat chop (where neither does). - Rail poke and rejection: The just-closed candle must overshoot an expanding rail but then reject it — closing back inside the rail with a reaction close in the far portion of its own range.
The strategy signals a SHORT when:
- The most-recently-closed candle prints a fresh higher high above the rising upper rail (the poke).
- That candle then closes back below the rail (the snap-back inside).
- Its upper wick is at least
RejectFracof the candle's total range, confirming price was rejected off the high.
The strategy signals a LONG when:
- The most-recently-closed candle prints a fresh lower low below the falling lower rail.
- That candle closes back above the rail.
- Its lower wick is at least
RejectFracof the candle's range, confirming rejection off the low.
Stop-loss logic: For a short, the stop sits just above the pierced high (trigger high + BufferFrac × average range); for a long, just below the pierced low. This places the stop at the exact level where the reversion thesis would be invalidated — if price pushes back through the pierced rail, the pattern has failed.
Take-profit logic: The target is a fixed multiple of the structural stop distance, set by RewardRatio, projecting back toward the formation's middle. The strategy also enforces one position at a time per magic number, skips trades when the spread is wider than MaxSpreadPoints, and evaluates only once per freshly closed bar.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| Lookback | 40 | 15 | 120 | Number of bars scanned to locate the recent swing pivots that define the rails. |
| FractalWindow | 3 | 1 | 8 | Symmetric fractal window (bars on each side) required to confirm a swing pivot. |
| MinExpansion | 0.30 | 0.00 | 2.50 | Minimum divergence of each rail versus the prior pivot, as a multiple of average bar range. |
| RejectFrac | 0.50 | 0.30 | 0.90 | Reaction-close requirement: the wick must be at least this fraction of the candle's range. |
| BufferFrac | 0.25 | 0.00 | 1.50 | Stop buffer placed beyond the pierced rail, as a fraction of average bar range. |
| RewardRatio | 1.30 | 0.50 | 4.00 | Take-profit distance as a multiple of the structural stop distance. |
| MaxSpreadPoints | 30 | 1 | 300 | Skip the trade if the current spread (in points) is wider than this value. |
| Lots | 0.10 | 0.01 | 1.00 | Trade volume in lots. |
| Magic | 7042 | 0 | 9,999,999 | Magic number used to identify and manage this EA's positions. |

Recommended Chart Settings
The Broadening Range Reversal was designed with liquid, actively traded instruments in mind — such as EUR/USD, GBP/USD, or XAU/USD (gold) — on the M15, M30, or H1 timeframes. These conditions tend to produce the emotional, two-sided swings in which broadening formations appear most clearly. Because every threshold scales off average bar range, the EA can technically run on any symbol or timeframe your backtest selects.
Keep in mind that market behavior differs across sessions, instruments, and volatility regimes. Results will vary considerably across different market conditions, and a setting that suits one symbol may behave very differently on another. Always test any configuration on historical data and a demo account before drawing conclusions.
How to Install on MetaTrader 5
- Download the
BroadeningRangeReversal.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
The core strength of this approach is its structural clarity. By requiring both rails of the range to provably diverge, the strategy isolates a specific, well-defined pattern rather than trading vague noise. Its stops are structural — placed at the precise level where the reversion idea is invalidated — which keeps risk tied directly to the pattern's logic rather than an arbitrary point count. Being indicator-free, it is also fully transparent: every rule maps to something visible on the candles.
However, the broadening formation has real limitations. It is a comparatively rare pattern, so signals may be infrequent; long stretches can pass without a valid setup. As a counter-trend, mean-reversion method, it is inherently vulnerable to strong directional moves — when an overshoot is not a trap but the start of a genuine breakout, the fade will be stopped out. Megaphones can also be difficult to define objectively, and fractal pivots are only confirmed after the fact, which introduces a natural lag. In trending or low-volatility conditions, the dual-expansion gate will (by design) filter out most trades, which may leave the EA idle for extended periods.
No pattern works in all environments. This strategy may underperform in persistent trends, during major news-driven breakouts, or in thin, illiquid markets where spreads widen and overshoots do not cleanly revert. Treat it as one structural idea to study, not a complete trading plan.
Risk Management Tips
Sound risk management matters far more than any single entry rule. Consider the following general principles:
- Position sizing: Size trades so that a losing streak does not threaten your account. Many educational sources suggest risking no more than 1–2% of account equity on any single trade.
- Use a demo account first: Test the EA thoroughly in a risk-free demo environment until you understand how it behaves across different conditions before considering any live capital.
- Understand drawdown: Every strategy experiences losing periods. Study the depth and duration of historical drawdowns so you know what to expect emotionally and financially.
- Respect the stop: The structural stop is central to this system's logic. Disabling or widening it removes the very protection that defines the pattern's risk.
- Diversify and avoid over-leverage: Concentrating risk in one instrument or using excessive leverage can magnify losses quickly. Keep leverage conservative.
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: BroadeningRangeReversal.ex5 (12 downloads)
- Source Code: BroadeningRangeReversal.mq5 (12 downloads)
- Documentation: BroadeningRangeReversal.pdf (18 downloads)