Blog / Strategy
Strategy

Pivot 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 Engulfing Hedge is a pure price-action expert advisor (EA) for MetaTrader 5 that combines three classic tools — floor pivot levels, the engulfing candlestick pattern, and a managed hedge — into a single intraday breakout system. It uses no lagging indicators at all: there is no moving average, RSI, ATR, or Bollinger Band anywhere in its logic. Every decision is made from raw open, high, low, and close prices, which keeps the strategy transparent and easy to study.

At its core, the strategy is a momentum-breakout approach. Floor pivots are reference price levels (a central pivot point plus support and resistance levels) that intraday desks watch and defend. An engulfing candle is a two-bar reversal pattern where the most recent candle's body completely swallows the prior candle's body, signalling that one side has decisively taken control. The Pivot Engulfing Hedge waits for a full-bodied engulfing candle to close cleanly through a pivot level — interpreting that as one side overwhelming the other right where the whole market is looking — and trades in the direction of the break.

This EA is best suited to traders who want to learn how breakout-and-hedge mechanics work rather than those seeking a hands-off solution. Because it includes a hedge leg (an opposite position opened when a breakout fails), it is a useful case study in how some systems attempt to manage false breakouts. It is designed for liquid, level-respecting markets such as the EUR/USD, GBP/USD, or XAU/USD (gold) on intraday timeframes, where genuine pivot breaks and false breaks tend to alternate.

How It Works

The strategy recalculates its floor pivots on every freshly closed bar using only the primary chart timeframe. Over the last PivotLookback closed bars it finds the highest high (H), lowest low (L), and most-recent close (C), then derives:

The "pivot range" (H − L, which equals R1 − S1) is used to size every buffer and target. Because all distances are expressed as a fraction of that range, the system scales to any symbol or timeframe with no hard-coded pip values.

Entry conditions (the strategy only looks for new trades when flat):

Stop-loss logic:

Take-profit and the hedge:

Basket exits (the dominant exit once any position is held):

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
PivotLookback 24 5 150 Number of closed bars whose H/L/C define the floor pivots.
BreakFrac 0.10 0.00 0.60 How far beyond a pivot the engulfing must close to confirm the break (fraction of the pivot range).
EngulfRatio 1.10 1.00 4.00 The engulfing body must be at least this multiple of the prior body (strength filter).
HedgeFrac 0.25 0.05 1.00 Pullback back across the broken pivot that confirms a false break and deploys the hedge.
StopFrac 0.30 0.05 2.00 Extra base-stop pad placed beyond the hedge trigger (fraction of the range).
RewardFrac 1.00 0.20 4.00 Base take-profit scalp distance from entry (fraction of the range).
ReclaimFrac 0.30 0.05 1.50 Hedge invalidation pad — if price reclaims the breakout side by this, the hedge is deemed wrong.
BasketTpMoney 25.0 5.0 2000.0 Close the whole basket once net floating profit reaches this (account currency).
BasketSlMoney 300.0 50.0 100000.0 Flatten the whole basket once net floating loss reaches this (account currency).
MaxSpreadPoints 50 0 500 Skip new entries while spread (points) exceeds this (0 = off).
Lots 0.10 0.01 1.00 Trade volume per leg.
Magic 8310 0 9,999,999 Magic number used to identify this EA's positions.
pivot engulfing hedge MT5 EA — MQL5 source code

Recommended Chart Settings

The Pivot Engulfing Hedge was designed for liquid FX majors such as EUR/USD and GBP/USD, or XAU/USD (gold), on intraday timeframes of M5, M15, or M30 — the conditions where pivot breaks and false breaks tend to alternate. Because every distance scales to the pivot range, it will technically run on any symbol and timeframe selected at backtest time, but its behaviour was conceived around these instruments.

Importantly, the hedge mechanic requires a hedging account so that opposite legs can be held at the same time. On a netting account, an opposite order will net (reduce) the base leg instead of locking it, which changes the strategy entirely — the MQL5 version logs a warning in this case. Results will vary considerably across different brokers, spreads, and market conditions, so treat any single configuration as a starting point for study rather than a finished setup.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths. The strategy's logic is fully transparent and indicator-free, which makes it an excellent learning tool for understanding pivots, engulfing patterns, and breakout confirmation. Its range-relative sizing means there are no magic pip numbers to retune for each symbol. The hedge-and-basket design is also an instructive example of how some systems try to recover from false breakouts rather than simply taking the loss.

Known limitations. Hedging strategies are not a free lunch. When a hedge locks in an opposing pair, a strong, sustained one-way trend can carry both legs into a widening net loss until the BasketSlMoney ceiling flattens the basket — which is why that hard limit exists. Engulfing breakouts can also fail repeatedly in choppy, low-volatility conditions, producing a series of small losing baskets. Because the EA holds floating positions and relies on net P/L exits rather than tight per-trade stops, drawdown can build during difficult periods.

Where it may underperform. Quiet, range-bound sessions with frequent fakeouts, news-driven spikes that blow through stop distances, and high-spread instruments can all degrade results. Always confirm your broker offers a hedging account and realistic spreads before relying on this logic. Historically, no breakout pattern wins every time — the goal of studying this EA is to understand how the components interact, not to expect a particular outcome.

Risk Management Tips

Sound risk management matters far more than any single entry signal. Consider these general principles as you study this strategy:

These are educational principles, not guarantees — every trader's circumstances differ, and you remain responsible for your own decisions.

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