Blog / Strategy
Strategy

Pivot Anchor Engulfing Hedge

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 Anchor Engulfing Hedge is a pure price-action Expert Advisor (EA) for MetaTrader 5 that combines classic floor pivot points with the engulfing candlestick pattern in a counter-trend, or "fade," trading style. It uses no technical indicators at all — no moving averages, no oscillators, no momentum tools. Instead, every decision is built from raw price: the prior day's high, low, and close, and the shape of the two most recently completed candles.

Floor pivots are a set of horizontal reference levels — the Pivot Point (PP), two resistance levels (R1, R2), and two support levels (S1, S2) — calculated from the previous trading day's range. Many traders watch these levels because price often reacts to them, either bouncing away or breaking through. An engulfing candle is a two-bar reversal pattern in which a candle fully "engulfs" the body of the one before it, often signalling that momentum has shifted. This strategy waits for both signals to line up at the same place: an engulfing candle forming right at a pivot level.

This EA is best suited to traders who are studying how support and resistance interacts with candlestick reversals, and who want a transparent, rules-based example to dissect. Because it is a learning tool rather than a turnkey solution, it is most valuable to those comfortable running backtests, reading the logic, and experimenting on a demo account. Treat it as a structured case study in mean-reversion and breakout mechanics, not as a shortcut.

How It Works

The strategy runs entirely on your chart's primary timeframe and rebuilds the daily pivots itself by aggregating bars and detecting the calendar-date rollover. Here is the full sequence of logic:

pivot engulfing hedge MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lots 0.10 0.01 1.0 Fixed trade size in lots for every position, including the hedge.
RewardRisk 1.6 0.5 4.0 Reward-to-risk multiple. The take-profit distance equals this value times the stop-loss distance.
ProximityPercent 12.0 2.0 40.0 How close a candle's wick must come to a pivot, expressed as a percent of the prior day's range, to count as "touching" it.
SlBufferPercent 12.0 0.0 60.0 Extra cushion added beyond the signal candle's extreme when placing the stop, as a percent of that candle's range.
BreakoutPercent 18.0 5.0 60.0 How far beyond the anchored pivot price must close to trigger the hedge, as a percent of the prior day's range.
SetupExpiryBars 6 1 30 Number of bars a setup stays active before it expires if the pivot is neither broken nor resolved.
EnableHedge 1 0 1 Toggles the breakout hedge logic. Set to 1 to enable, 0 to trade fades only.
pivot engulfing hedge MT5 EA — MQL5 source code

Recommended Chart Settings

This strategy was designed to be applied to a single chart on its primary timeframe, which it also uses to reconstruct the daily pivots. An intraday timeframe such as M15, M30, or H1 tends to align well with daily floor pivots, giving enough completed bars per day for setups to form while keeping the pivot levels meaningful. Liquid instruments with clean, well-defined daily ranges — major forex pairs such as EUR/USD or GBP/USD, or a major index CFD — are natural candidates for study because pivot levels behave more consistently when spreads are tight and ranges are orderly.

Bear in mind that pivot behaviour is not uniform across symbols or sessions. Results will vary across different market conditions, instruments, and broker feeds. Always confirm how the daily rollover and pivots are calculated on your specific broker's server time before drawing conclusions, since the "calendar day" the EA detects depends on that clock.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Like any approach, the Pivot Anchor Engulfing Hedge has clear strengths and clear limitations, and understanding both is the point of studying it.

Strengths. The logic is transparent and fully price-based, which makes it an excellent teaching example — there are no opaque indicator calculations to obscure why a trade fired. Requiring an engulfing candle and pivot proximity and a close back through the level is a multi-condition filter that screens out many low-quality signals. Defining the stop just beyond the engulfing extreme ties risk directly to the structure that would invalidate the idea. The optional hedge is a thoughtful attempt to address the classic weakness of fading: pivots sometimes break rather than hold, and the breakout conversion is designed to participate when they do.

Known limitations. Counter-trend, mean-reversion strategies tend to struggle in strong, sustained trends, where support and resistance levels are broken repeatedly rather than respected. In choppy, low-range days the pivots cluster tightly and signals may be noisy or conflicting. The hedge does not close the original losing position — it adds an opposing one — so during a clean breakout it is possible for the fade's stop to be hit while the hedge is still developing, meaning both positions carry risk simultaneously. Fixed lot sizing does not adapt to volatility or account size. And because pivots reset daily, the strategy is sensitive to how your broker defines the trading day.

Where it may underperform. Expect weaker behaviour during high-impact news spikes, illiquid sessions with wide spreads, and persistent one-directional trends. The strategy historically suits range-bound or rotational conditions far better than runaway momentum. None of this is a verdict — it is a map of where to focus your own testing.

Risk Management Tips

Sound risk management matters more than any single entry rule. Keep these general principles in mind as you study this EA:

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

← Back to Blog