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 Rebound Hedge is a pure price-action expert advisor (EA) for MetaTrader 5 that combines the engulfing candlestick pattern with a rolling pivot point framework and a built-in hedging recovery mechanism. An engulfing pattern is a two-candle formation where the body of the most recent candle fully "engulfs" the body of the candle before it — often read by traders as a sign that momentum is shifting. A pivot point is a reference price level used to gauge potential support and resistance. What makes this strategy distinctive is that it uses no traditional indicators at all: there is no moving average, no RSI, and no ATR. Every decision is derived directly from raw candle data.
Instead of using a fixed daily session to calculate pivots, the strategy computes a rolling pivot from the last N closed bars. It applies classic floor-pivot math — the central Pivot Point (PP), first resistance (R1), and first support (S1) — but on a continuously moving window. This lets the strategy adapt its support and resistance map as the market drifts, rather than anchoring to a single calendar session. It then waits for an engulfing candle to form near one of these levels and trades the reaction.
This EA is designed for range-bound and rejection-prone conditions on liquid markets, and it is best understood as a learning tool for studying how candlestick patterns interact with dynamic support and resistance. It suits traders who already understand basic order mechanics and want to explore how a rules-based system frames price action, sizes risk from volatility, and manages an adverse position. It is an analytical study of structure and reaction — not a shortcut, and not a profit opportunity.
How It Works
The strategy operates on closed bars and evaluates one new signal per bar while it is flat. Here is the logic in plain English:
- Building the rolling pivot: On each new bar, the EA scans the last
PivotLookbackclosed bars to find the highest high, the lowest low, and the most recent close. From these it calculatesPP = (High + Low + Close) / 3, thenR1 = 2 × PP − LowandS1 = 2 × PP − High. These three levels define the support/resistance frame for the next decision. - Measuring volatility by hand: The EA also averages the bar range (high minus low) over the same window. This "average range" acts as a volatility proxy and is used to size stops and targets — no ATR indicator is involved.
- Detecting the engulfing pattern: The strategy compares the two most recent closed candles. A bullish engulfing requires the latest candle to close up while the prior candle closed down, with the latest body engulfing the prior body. A bearish engulfing is the mirror image.
- Reversal (rebound) entries: The strategy signals a long when a bullish engulfing dips to or below S1 but closes back above it — interpreted as a rejection of support. It signals a short when a bearish engulfing pokes to or above R1 but closes back below it — interpreted as a rejection of resistance.
- Breakout entries: The strategy signals a long when a bullish engulfing closes above R1 for the first time (a fresh resistance breakout), and a short when a bearish engulfing closes below S1 for the first time (a fresh support breakdown).
- Standing aside: If neither a long nor a short condition is uniquely satisfied — or if the conditions are ambiguous — the EA takes no trade.
- Stop-loss logic: The stop distance is set to
StopMult × average range, but never tighter than the symbol's minimum allowed stop distance. The stop is placed below entry for longs and above entry for shorts. - Take-profit logic: The target distance is set to
TpMult × average range, also respecting the broker's minimum distance. With the default multipliers, the target is wider than the stop, giving a reward-to-risk profile greater than 1:1 on each individual trade. - The hedge mechanism: If an open position runs adverse by
HedgeTriggerMult × average range, the strategy arms one opposite-side hedge, sized asHedgeVolumeMultof the original volume. The idea is to cap drawdown if price breaks against the initial read. Once a hedge exists, the per-leg stop-loss and take-profit resolve the cycle. If a single leftover leg remains after the other closes, the strategy flattens it so every cycle ends cleanly before a new one can begin.
Because opposite-side positions must coexist, the EA requires a hedging-type MT5 account rather than a netting account.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| PivotLookback | 20 | 8 | 60 | Number of closed bars used to build the rolling pivot (PP/R1/S1) and the average-range volatility proxy. |
| StopMult | 1.0 | 0.5 | 3.0 | Stop-loss distance as a multiple of the average bar range. |
| TpMult | 1.6 | 0.5 | 4.0 | Take-profit distance as a multiple of the average bar range. |
| HedgeTriggerMult | 1.0 | 0.3 | 2.5 | Adverse excursion, in range multiples, that arms the recovery hedge. |
| HedgeVolumeMult | 1.0 | 0.5 | 2.0 | Hedge volume expressed as a multiple of the primary order's lots. |
| Lots | 0.10 | 0.01 | 1.0 | Primary order volume, snapped to the symbol's volume step and limits. |
| Magic | 880142 | 0 | 9,999,999 | Unique magic number so the EA only manages its own positions. |

Recommended Chart Settings
The Engulfing Rebound Hedge was designed for liquid FX majors or metals (such as EUR/USD, GBP/USD, or gold) on the M5 to M15 timeframes. On these lower timeframes, engulfing rejections at rolling pivots occur frequently enough to study, and the average-range sizing keeps stops proportional to short-term volatility. As always, behaviour will vary across different instruments, brokers, spreads, and market conditions — a setting that looks balanced on one symbol may behave very differently on another, so treat these as starting points for your own research rather than fixed recommendations.
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
This strategy has some genuine conceptual strengths. Because it uses no lagging indicators, every signal is anchored to current price structure, which can make its logic easier to study and reason about. Sizing stops and targets from the average bar range means risk scales with recent volatility rather than a fixed pip value, and the rolling pivot keeps support and resistance levels current as the market moves. Trading both reversals and breakouts gives it two distinct ways to engage with a level.
That said, you should weigh the limitations honestly. Engulfing patterns are common and not all of them mark a true turning point — many "rejections" simply continue in the original direction. Pivot-based levels are heuristics, not magnets; price frequently slices through them. The hedging component is the area that demands the most caution: hedging does not eliminate loss, it restructures it. A hedge can lock in a spread cost on both legs, and in choppy conditions the strategy may open, hedge, and flatten repeatedly without making progress. In strongly trending markets, the reversal logic may repeatedly fight the trend, while in dead, low-volatility ranges, signals may be sparse and stops may sit very close to entry. No parameter set performs well across all regimes, and over-optimising on past data is a real risk.
Risk Management Tips
Sound risk management matters more than any single entry rule. Keep these principles in mind as you study this EA:
- Risk only a small fraction per trade. A common guideline is to risk no more than 1–2% of account equity on any single position. Set your
Lotsaccordingly for your account size, and remember that the hedge can add exposure. - Test on a demo account first. Run the strategy on a demo or in the Strategy Tester for an extended period before considering any live capital, so you understand how it behaves through different conditions.
- Understand drawdown. Even a strategy with a sensible reward-to-risk ratio can experience losing streaks. Know the maximum drawdown you are willing to tolerate before you begin.
- Account for costs. Spreads, commissions, and swap can meaningfully affect a high-frequency, low-timeframe approach — and a hedging cycle pays those costs on more than one leg.
- Size hedges deliberately. A
HedgeVolumeMultabove 1.0 increases exposure rather than reducing it; treat larger hedge volumes with extra care. - Never risk money you cannot afford to lose, and review your settings regularly as market conditions change.
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: EngulfingReboundHedge.ex5 (3 downloads)
- Source Code: EngulfingReboundHedge.mq5 (3 downloads)
- Documentation: EngulfingReboundHedge.pdf (3 downloads)