Blog / Strategy
Strategy

Engulfing Pivot Guard

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?

Engulfing Pivot Guard is a pure price-action expert advisor (EA) for MetaTrader 5 that combines two classic tools — floor pivot points and the engulfing candlestick pattern — into a single intraday system. A floor pivot is a set of reference levels (a central pivot PP, a resistance level R1, and a support level S1) calculated from recent highs, lows, and closes. An engulfing pattern is a two-candle formation in which the most recent candle's body completely "swallows" the prior candle's body, a sign that order flow has flipped from one side of the market to the other. Notably, this strategy uses no traditional indicators — there is no moving average, RSI, ATR, or Bollinger Band anywhere in its logic.

The strategy is designed for range-respecting, mean-reverting market conditions — the kind of environment where price repeatedly tests support and resistance and rotates back toward a central value. It interprets an engulfing candle differently depending on where it forms: at an outer pivot (R1 or S1) it treats the engulf as exhaustion and trades a reversal back to the central pivot; at the central pivot it treats the engulf as acceptance and trades a breakout toward the next outer level. Because every distance is measured as a fraction of the pivot range rather than in hard-coded pips, the system scales automatically across symbols and timeframes.

As a learning tool, Engulfing Pivot Guard is well suited to traders who want to study how candlestick patterns interact with structural levels, and how a hedging — or "guard" — mechanic can be used to manage a trade that moves against the original idea. This article frames the EA as a strategy analysis, not a profit opportunity. The goal is to help you understand the mechanics so you can evaluate the approach critically.

How It Works

The strategy recomputes its pivots on every closed bar using the highest high (H), lowest low (L), and the signal candle's close (C) over the most recent PivotLookback bars: PP = (H + L + C) / 3, R1 = 2·PP − L, S1 = 2·PP − H. The pivot range (H − L) sizes every buffer and target.

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

Reversal setups are checked before breakout setups so that a single candle near the pivot cannot trigger both.

Stop-loss logic:

Take-profit logic:

The guard / hedge mechanic is the signature feature:

Basket money management is the dominant exit while any exposure is held:

Engulfing Pivot Guard 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 high/low/close define the floor pivots.
EngulfFactor 1.00 0.80 3.00 Engulfing body must be at least this multiple of the prior body (≥1 = full engulf).
ZoneFrac 0.12 0.02 0.60 How close to a pivot the signal candle must reach, as a fraction of the pivot range.
GuardFrac 0.25 0.05 1.00 Distance beyond the leaned-on level that confirms it failed and raises the guard.
StopFrac 0.30 0.05 2.00 Extra base-stop pad placed beyond the guard trigger (fraction of the pivot range).
ReclaimFrac 0.20 0.05 1.50 Reclaim past the level, in the base's favour, that drops the guard (fraction of range).
RewardFrac 0.70 0.20 4.00 Minimum reward distance for the base take-profit (fraction of the pivot range).
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 the spread (in points) exceeds this value (0 = off).
Lots 0.10 0.01 1.00 Base and guard trade volume in lots.
Magic 5310 0 9,999,999 Unique EA magic number used to identify this strategy's positions.
Engulfing Pivot Guard MT5 EA — MQL5 source code

Recommended Chart Settings

Engulfing Pivot Guard was designed for liquid, range-respecting FX majors such as EUR/USD or AUD/USD, or for gold (XAU/USD), on the M15, M30, or H1 timeframes — environments where pivot exhaustion and acceptance tend to alternate. Because all distances scale with the pivot range, the EA runs on whichever timeframe is selected at the time, with no pip values to retune. Keep in mind that results will vary considerably across different symbols, brokers, and market conditions, and that a setup that historically behaved well in a ranging market may behave very differently when a strong trend develops.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths. The strategy is conceptually clean: it relies on a single, well-defined candlestick trigger and well-known structural levels, with no lagging indicators to second-guess. Its pivot-relative sizing means it adapts to volatility automatically, and the guard mechanic gives it a defined response when a level fails rather than simply absorbing a full stop. Trading only when flat keeps the logic transparent and easy to study.

Known limitations. Engulfing patterns are common and not all of them mark genuine reversals or breakouts, so false signals are an inherent part of the approach. Pivot levels are not magical — price can slice straight through them, especially around news. Most importantly, the hedging / basket design carries a specific risk profile: when a level fails and the guard locks the position, a strong one-way trend can push the basket toward its BasketSlMoney ceiling. In that scenario, the loss realized in one event can be larger than the small, frequent gains the system is designed to bank — a classic characteristic of basket-and-hedge systems that you should understand fully before risking capital.

Where it may underperform. Trending or strongly breaking markets, illiquid sessions with wide spreads, and instruments that do not respect intraday pivots are all conditions where this mean-reversion-leaning logic may struggle. The MaxSpreadPoints filter helps avoid the worst spread conditions, but it cannot protect against sustained directional moves.

Risk Management Tips

Sound risk management matters more than any single entry rule. Consider the following general principles 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