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 Engulfing Reversal Hedge is a pure price-action reversal and scalping strategy built around the classic two-candle engulfing pattern — a formation where one candle's body completely swallows the previous candle's body, signalling that one side of the market has just overwhelmed the other. Unlike most expert advisors, this strategy uses no technical indicators of any kind. There is no moving average, RSI, ATR, or Bollinger Band anywhere in its logic. Every decision is derived from raw candle geometry and swing structure on the chart's primary timeframe.
The idea weaves together five well-known price-action concepts: a pivot (a fractal swing high or low that marks a structural turning point), an engulfing pattern at that pivot, a reversal read of the prior leg, a breakout confirmation, and a hedge safety mechanism. In plain terms, the strategy waits for an engulfing candle to print right at a confirmed swing extreme, then arms a stop order beyond that candle so it only enters if price actually follows through. If the entry fills but then reverses against the position, the strategy deploys an opposite leg to lock the move rather than taking a clean stop-out.
This makes the Engulfing Reversal Hedge most relevant as a learning tool for traders studying how reversal patterns, breakout confirmation, and hedging interact. It is designed for fast, structured markets and is best treated as a framework for understanding price-action mechanics — not as a shortcut to results. Because it relies on a hedging mechanism, it requires a hedging-mode account so the opposite leg can coexist with the base position instead of netting it out.
How It Works
The strategy evaluates the market once per freshly closed bar and manages live positions on every tick. Here is the full logic in plain English:
- Finding the pivot: The strategy scans recent closed bars for a confirmed fractal swing low or swing high — a bar that is the local extreme, with
PivotSpanstrictly lower (or higher) bars on each side. This pivot marks the structural level the strategy intends to trade against. - Spotting the engulfing pattern: It then checks the two most recent closed candles for a textbook engulfing formation. A bullish engulfing is an up-candle whose body engulfs a prior down-candle; a bearish engulfing is the mirror image.
- Confirming the location: The engulfing extreme must sit within
ZoneFracof the lookback range from the pivot. This filters out engulfings that print far away from real structure. - Reversal read: A bullish engulfing at a swing low is read as a potential turn upward; a bearish engulfing at a swing high is read as a potential turn downward. The strategy fades the prior leg.
- Breakout entry (not a close entry): Rather than entering on the candle close, the strategy arms a stop order just beyond the engulfing candle's extreme, offset by
TriggerFracof the candle range. The trade only fills if price breaks out and follows through — engulfings that fizzle never trigger an entry. - Entry expiry: If the armed stop order is not filled within
EntryExpiryBarsclosed bars, it is cancelled so a stale setup does not linger. - Stop-loss logic: The base stop is placed a pad beyond the hedge trigger, sized to
(HedgeFrac + StopFrac)of the engulfing range. This deliberately ensures the hedge engages before the base stop would ever be hit. - Take-profit logic: The base take-profit is set at
RewardRatiomultiplied by the entry-to-stop distance — a quick scalp target scaled to the pattern itself. - The hedge: If the breakout fills but then price travels back against the position by
HedgeFracof the pattern range, the strategy reads this as a false break and opens an opposite market leg. It now holds both directions — a locked hedge that rides the adverse move and offsets the trapped base leg. - Basket management: The hedged pair is governed as a single basket. The whole basket is closed once net floating profit reaches
BasketTpMoney, and flattened entirely once net floating loss reachesBasketSlMoney.
Because every distance scales to the engulfing candle's own range, the strategy adapts to different symbols and timeframes without any hard-coded pip values.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| PivotSpan | 3 | 2 | 10 | Fractal half-width: how many lower/higher bars are required on each side for a bar to qualify as a swing pivot. |
| SwingLookback | 30 | 10 | 120 | How many recent closed bars to scan for the latest swing pivot and the range used for tolerance. |
| ZoneFrac | 0.35 | 0.05 | 1.00 | The engulfing extreme must sit within this fraction of the lookback range from the swing pivot. |
| TriggerFrac | 0.10 | 0.00 | 1.00 | Breakout buffer placed beyond the engulfing extreme for the stop entry (× engulfing range). |
| HedgeFrac | 0.60 | 0.10 | 2.00 | Adverse travel past the fill (× engulfing range) that flags a false break and deploys the hedge. |
| StopFrac | 0.50 | 0.10 | 3.00 | Extra base-stop pad placed beyond the hedge trigger (× engulfing range). |
| RewardRatio | 1.50 | 0.50 | 5.00 | Base take-profit as a multiple of the base risk (entry-to-stop distance). |
| EntryExpiryBars | 3 | 1 | 20 | Cancel an unfilled breakout stop order after this many closed bars. |
| BasketTpMoney | 25.0 | 5.0 | 2000.0 | Close the whole basket once net floating profit reaches this amount (account currency). |
| BasketSlMoney | 300.0 | 50.0 | 100000.0 | Flatten the whole basket once net floating loss reaches this amount (account currency). |
| MaxSpreadPoints | 50 | 0 | 500 | Skip new setups while spread (in points) exceeds this value (0 = filter off). |
| Lots | 0.10 | 0.01 | 1.00 | Order volume for each leg, snapped to the symbol's volume step and limits. |
| Magic | 4815 | 0 | 9,999,999 | Magic number used to identify and manage this EA's own orders. |

Recommended Chart Settings
The Engulfing Reversal Hedge was designed for liquid markets with clean swing structure: a major FX pair such as EUR/USD or GBP/USD, or XAU/USD (gold), on the M5 or M15 timeframe. These are fast enough for scalp-style targets while still printing readable swing pivots and engulfing patterns.
The strategy runs on whatever timeframe the chart is set to, so you can experiment with others — but be aware that pattern frequency, spread sensitivity, and hedge behaviour all change with the symbol and timeframe. Results will vary considerably across different market conditions, instruments, and brokers, so treat any single configuration as a starting point for study rather than a finished setting.
How to Install on MetaTrader 5
- Download the .ex5 file 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 strength of this approach is its discipline. An engulfing bar at a confirmed swing is one of the more respected discretionary reversal cues, and requiring a follow-through breakout filters out many of the engulfings that false-fire. The hedge mechanism is genuinely different from a simple stop-loss: rather than booking a clean loss on a false break, it converts that move into a managed, sometimes-recoverable basket.
That same design carries real limitations you should understand. Hedging strategies can accumulate floating losses if price chops back and forth or trends hard against the locked pair, and the BasketSlMoney money-stop is the ultimate backstop — it can still close the basket at a meaningful loss. The strategy requires a hedging-mode account; on a netting account the opposite leg will simply reduce the base position instead of hedging it, breaking the core logic. Like all reversal systems, it tends to struggle in strong, persistent trends where "the turn" keeps failing, and it depends on a steady supply of clean engulfing-at-swing setups, which thin out in low-volatility or news-distorted conditions. Wide spreads also matter for a scalp-style target, which is why the MaxSpreadPoints filter exists.
Treat this EA as a way to study how reversal patterns, breakout confirmation, and hedging interact — not as a hands-off solution.
Risk Management Tips
Sound risk management matters more than any single parameter setting. As a general educational guide:
- Risk only a small fraction per setup — many educators suggest no more than 1–2% of account equity exposed to any one idea. Size
Lots,BasketSlMoney, and your account balance together so a worst-case basket stop stays within that limit. - Always start on a demo account. Run the strategy in simulation across varied conditions before risking real capital, and watch how the hedge behaves during adverse moves.
- Understand drawdown. Hedging baskets can sit in floating loss for extended periods; make sure your account can tolerate that without a margin call.
- Test before you trust. Forward-test on a demo and review behaviour across trending, ranging, and high-spread sessions.
- Never trade with money you cannot afford to lose, and keep position sizes consistent rather than increasing them after a losing run.
You will learn the most by observing why trades arm, fill, hedge, and flatten — not just whether a given run ended in profit or loss.
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: EngulfingReversalHedge.ex5 (3 downloads)
- Source Code: EngulfingReversalHedge.mq5 (3 downloads)
- Documentation: EngulfingReversalHedge.pdf (3 downloads)