Blog / Strategy
Strategy

Session VWAP 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 Session Vwap Engulfing Hedge is a pure price-action, mean-reversion expert advisor (EA) for MetaTrader 5 that is built entirely by hand from raw price bars — it uses no library indicators such as moving averages, RSI, Bollinger Bands, or ATR. Its centerpiece is a session-anchored VWAP (Volume-Weighted Average Price), the running average price each bar trades at, weighted by volume. Around that VWAP it constructs its own standard-deviation bands to measure how far price has stretched from "fair value," and it combines this with three classic price-action concepts: an engulfing candle reversal pattern, a liquidity sweep of recent highs or lows, and an imbalance (Fair Value Gap) displacement filter.

The strategy is designed for liquid, intraday markets where price tends to oscillate around value — think FX majors like EUR/USD and GBP/USD, gold (XAU/USD), or an index CFD — on intraday timeframes such as M5, M15, or M30. The core idea is that when price is pushed a long way from VWAP, it becomes statistically "expensive" or "cheap" relative to the day's traded value, and the final stretch often runs stops at a recent swing point before snapping back toward the mean.

As a learning tool, this EA is best suited to traders who want to study how institutional-style "value" concepts (VWAP, standard-deviation bands) can be combined with retail-popular price-action triggers (engulfing bars, sweeps, Fair Value Gaps) and a reactive hedging mechanic. This is a strategy analysis, not a profit opportunity — the goal here is to understand how the logic is constructed and where it may struggle.

How It Works

The strategy stays completely flat until a clean setup appears, then manages each trade with structural stops and a reactive hedge. Entry logic is evaluated once per freshly closed bar, while hedge management runs on every tick.

Building the VWAP and bands:

The strategy signals a LONG when all of these align:

The strategy signals a SHORT under the exact mirror conditions: price stretched above the upper band, a sweep of recent resistance (new local high), a bearish engulfing bar, downward displacement or a bearish Fair Value Gap, sufficient momentum, and a close still above VWAP.

Stop-loss and take-profit logic (per leg, structural):

The reactive hedge (the signature mechanic):

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

Strategy Parameters

Parameter Default Min Max Description
DeviationMult 2.00 1.00 3.50 Standard deviations from VWAP that count as "stretched" (band half-width).
RangeLookback 14 5 40 Bars used for the average range and average body baselines.
SweepLookback 10 3 40 Window the swept extreme must be the new low/high of (liquidity-grab depth).
MomentumMult 1.10 0.50 2.50 Trigger body must be at least this multiple of the recent average body.
StopPadFrac 0.50 0.10 3.00 Base stop pad beyond the swept extreme, in units of the average range.
MinRewardRisk 0.80 0.20 3.00 Rejects setups whose reward (entry→VWAP) is below this multiple of risk.
TpFloorMult 1.50 0.30 5.00 Fallback TP distance (avg-range units) if VWAP is too close for real reward.
HedgeTriggerFrac 0.70 0.20 1.50 Adverse excursion (fraction of base risk) that arms the reactive hedge.
HedgeReleaseFrac 0.30 0.05 1.00 Adverse excursion (fraction of base risk) at/below which a live hedge is released.
HedgeRewardFrac 1.00 0.20 4.00 Hedge TP distance beyond the base SL, in fractions of base risk.
HedgeReclaimFrac 0.50 0.10 2.00 Hedge SL distance on the reclaim side, in fractions of base risk.
HedgeMult 1.00 0.30 2.00 Hedge size as a multiple of the base size.
MinSessionBars 6 2 50 Minimum closed bars since the session anchor before VWAP/bands are trusted.
MaxSpreadPoints 50 0 500 Skip new entries while spread (points) exceeds this (0 = off).
Lots 0.10 0.01 1.00 Base trade size in lots.
Magic 7420 0 9,999,999 Unique magic number to identify this EA's orders.
session VWAP engulfing MT5 EA — MQL5 source code

Recommended Chart Settings

This strategy was designed for liquid, VWAP-respecting intraday instruments — FX majors such as EUR/USD or GBP/USD, XAU/USD (gold), or an index CFD — on the M5, M15, or M30 timeframes, where the stretch-sweep-snap rhythm around value tends to be most pronounced. Because every distance is derived from standard deviations and the average bar range, the logic adapts to any symbol or timeframe without hard-coded pip values. Results will vary considerably across different instruments, sessions, and market conditions, so treat these as a starting point for your own study rather than a fixed prescription.

Note that the reactive hedge opens an opposite market position while the base is live. This requires a hedging account; on a netting account the opposite order would simply net out the base, and the mechanic will not behave as intended.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. Building everything from raw bars means there are no indicator lag or repaint concerns, and the logic is transparent and auditable. Anchoring to VWAP gives the strategy an objective, volume-aware definition of "value," and requiring an engulfing bar plus a sweep plus displacement is a strict, multi-condition filter that historically reduces low-quality signals. The structural VWAP target is a logical place for a mean-reversion exit.

Known limitations. Mean reversion is, by design, the wrong stance during a strong trend day. When price stretches beyond a band and simply keeps going — a genuine breakout or news-driven move — the base trade fights the dominant direction. The hedge is meant to cap that scenario, but hedging is not a cure: it can convert one losing trade into two costs (spread, swap, and the gap between the legs), and a choppy "whipsaw" that repeatedly arms and releases the hedge may erode the account through transaction costs.

Where it may underperform. Thin liquidity, wide spreads, low-volatility ranges that never reach the bands, and erratic news periods all reduce signal quality. The strict multi-condition entry also means the EA may trade infrequently, so patience and realistic expectations matter. Always study its behavior on a demo account across many market conditions before drawing conclusions.

Risk Management Tips

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