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 Pivot Reversal Hedge is an intraday, price-action trading strategy for MetaTrader 5 that combines two of the oldest tools in technical analysis: classic floor pivot points and engulfing candlestick patterns. It uses no lagging indicators — no moving averages, no RSI, no ATR, no Bollinger Bands. Instead, it reads raw price structure, watching for the moment a market either respects or rejects a key pivot level. Its trading style is best described as a reversal scalp with a managed recovery hedge.
Floor pivots are horizontal reference levels calculated from the previous day's high, low, and close. The central pivot point (PP) and its derived support and resistance bands (S1, S2, R1, R2) form a price grid that many intraday desks watch closely. An engulfing candle is a two-bar reversal pattern in which the most recent candle's body completely covers the prior candle's body, signalling a sharp shift in short-term momentum. The Pivot Reversal Hedge looks for an engulfing candle forming right at a pivot level — a high-conviction sign that the level is being defended.
This strategy is designed primarily as a learning tool for traders who want to study how pivot levels and candlestick reversals interact, and how a hedging mechanism attempts to manage the risk of a level that fails to hold. It is best suited to range-respecting, liquid markets — major forex pairs such as EUR/USD and AUD/USD, or gold (XAU/USD) — on intraday timeframes. It is not a "set and forget" system, and the hedging logic in particular requires careful study before any live consideration.
How It Works
The strategy operates only when it is flat (no open positions) and acts on the close of each new bar. Every condition below is derived from price action alone.
- Pivot calculation: Once per calendar day, the strategy aggregates the previous day's bars and computes the floor pivots:
PP = (High + Low + Close) / 3,R1 = 2·PP − Low,S1 = 2·PP − High,R2 = PP + (High − Low), andS2 = PP − (High − Low). The day's range (High − Low) scales every internal buffer, so nothing is hard-coded in pips — the logic adapts to any symbol or timeframe. - Long entry signal: The strategy signals a long when a bullish engulfing candle forms whose low stabbed into a support pivot (S1 or S2) but whose close finished back above that level. In plain terms, sellers pushed price into support, buyers reclaimed it within a single bar, and the strategy fades the level upward.
- Short entry signal: The mirror image. The strategy signals a short when a bearish engulfing candle stabs a resistance pivot (R1 or R2) and closes back below it — sellers reclaimed resistance.
- Engulfing quality filter: The signal candle's body must be at least
EngulfRatiotimes the size of the candle it engulfs, screening out weak or marginal patterns. - Stop-loss logic: The base stop is placed beyond the engulfing candle's extreme — below the low for longs, above the high for shorts — padded by
StopRmultiples of the signal candle's range. This keeps the stop anchored to recent structure rather than a fixed distance. - Take-profit logic: Because this is a scalp, the base take-profit is a
RewardRmultiple of the engulfing candle's range, aiming to bank gains quickly rather than hold for a large move. - The hedge mechanic: If, after entry, price travels
HedgeTriggerRengulfing-ranges against the position, the strategy treats the pivot as having failed — the level that "should" have held has become a breakout. It then deploys an opposite-direction market order sized atLots × HedgeMultiplier. Both directions are now held as a locked pair. - Basket exits: Once a hedge is active, the strategy manages the pair on net floating profit/loss. If combined floating P/L reaches
BasketTpMoney, it closes everything to bank the recovery. If combined floating P/L falls to−BasketSlMoney, it flattens everything — a hard ceiling that caps the damage from a runaway trend. - Spread filter: New entries are skipped whenever the spread exceeds
MaxSpreadPoints, avoiding entries during illiquid or high-cost conditions.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| ZoneFrac | 0.15 | 0.02 | 0.80 | How close (as a fraction of yesterday's range) the engulfing low/high must stab the pivot to count as a touch. |
| EngulfRatio | 1.05 | 1.00 | 3.00 | The engulfing candle's body must be at least this multiple of the body it engulfs. |
| RewardR | 1.20 | 0.30 | 5.00 | Scalp take-profit, expressed in multiples of the engulfing (signal-bar) range. |
| StopR | 0.60 | 0.10 | 3.00 | Base stop-loss pad beyond the engulfing extreme, in multiples of the engulfing range. |
| HedgeTriggerR | 1.50 | 0.50 | 6.00 | Adverse travel (in engulfing-ranges from entry) that marks the pivot as failed and triggers the hedge. |
| HedgeMultiplier | 1.60 | 1.00 | 4.00 | Hedge volume equals base lots multiplied by this recovery factor. |
| BasketTpMoney | 30.0 | 5.0 | 2000.0 | Closes the whole basket once net floating profit reaches this amount (account currency). |
| BasketSlMoney | 350.0 | 50.0 | 100000.0 | Flattens the whole basket once net floating loss reaches this amount (account currency). |
| MaxSpreadPoints | 50 | 0 | 500 | Skip new entries while spread (in points) exceeds this value (0 disables the filter). |
| Lots | 0.10 | 0.01 | 1.00 | Base trade volume in lots. |
| Magic | 5310 | 0 | 9,999,999 | Unique magic number identifying this EA's trades. |

Recommended Chart Settings
The Pivot Reversal Hedge was designed for range-respecting, liquid major pairs such as EUR/USD and AUD/USD, or XAU/USD (gold), on intraday timeframes between M15 and H1. These are markets where pivot levels tend to hold and false breakouts alternate, which is the environment the engulfing-at-pivot logic is built around.
Because the strategy sizes its stops, targets, and hedge trigger from the previous day's range rather than fixed pip values, it scales naturally across symbols and timeframes. That said, results will vary considerably across different market conditions, instruments, and broker spread profiles. Always test any configuration on historical data and a demo account before drawing conclusions.
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
Every strategy has strengths and trade-offs, and understanding both is part of learning to evaluate trading systems critically.
Strengths. The approach is transparent and grounded in well-known concepts: floor pivots and engulfing candles are studied by traders worldwide, so the logic is easy to follow and audit. Because it uses no indicators, there is nothing to lag or repaint — entries are driven directly by completed price bars. Stops and targets are anchored to recent structure rather than arbitrary distances, and the spread filter helps avoid costly entries.
Limitations. The defining feature — the recovery hedge — is also its greatest risk. Adding an oversized opposite position when a level fails can turn a small loss into a much larger, locked exposure if the market trends strongly and never returns to a net-profitable state. The BasketSlMoney ceiling exists precisely because a runaway trend can otherwise keep the basket underwater. Pivot-fading strategies historically struggle in strongly trending markets, where levels break and keep going rather than reverting. Engulfing patterns at pivots can also produce false signals during news-driven volatility.
Where it may underperform. Sustained directional trends, low-liquidity sessions, wide-spread instruments, and major news events are all conditions where the strategy's reversal premise may break down and where the hedge can be tested repeatedly. Treat this EA as a study of mechanics, not as a guaranteed solution to any market.
Risk Management Tips
Sound risk management matters more than any single strategy. Keep these general principles in mind as you study this system:
- Size positions conservatively. Many educators suggest risking no more than 1–2% of account equity on any single idea. With a hedging system, account for the combined exposure of the base and hedge legs, not just the base lot.
- Understand drawdown. Recovery-style strategies can experience extended periods underwater before a basket resolves. Study how the
HedgeMultiplierandBasketSlMoneysettings shape worst-case exposure. - Start on a demo account. Test the strategy in a risk-free simulated environment until you fully understand how the entries, hedge trigger, and basket exits behave across different conditions.
- Set hard limits. Decide in advance how much you are willing to lose on the basket, and use the
BasketSlMoneyparameter as a non-negotiable ceiling. - Keep records. Logging your tests and reviewing them helps you learn far more than watching individual trades.
The goal of studying a strategy like the Pivot Reversal Hedge is to deepen your understanding of pivots, candlestick reversals, and trade management — not to chase a shortcut.
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: PivotReversalHedge.ex5 (5 downloads)
- Source Code: PivotReversalHedge.mq5 (3 downloads)
- Documentation: PivotReversalHedge.pdf (4 downloads)