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 Vwap Imbalance Fade Hedge is a pure price-action, mean-reversion strategy built around the intraday Volume-Weighted Average Price (VWAP) — the volume-weighted "fair value" that price tends to orbit during a normal trading session. Unlike many automated systems, it uses no traditional indicators at all: no moving averages, no RSI, no ATR, and no stochastics. Every decision is derived from raw bar highs, lows, and closes, combined with VWAP, three-bar fair-value-gap geometry, engulfing candle patterns, and swing support and resistance levels.
The core idea is mean reversion. When an emotional, over-extended thrust pushes price an abnormal distance away from VWAP and leaves behind a fair-value gap (a three-bar imbalance, where a section of price was skipped over and liquidity was left unfilled), that move is often exhausted. If the very next structure prints an engulfing reversal right at a swing extreme — support below or resistance above — the strategy interprets this as the auction rejecting the excursion, and it "fades" the move back toward the mean. Because the classic weakness of any fade is the day the excursion turns out to be a genuine breakout, the system can arm a single opposite recovery hedge when the fade runs too far against it.
This strategy is best understood as a learning tool for traders who want to study how VWAP, imbalance, and candlestick rejection patterns can be combined into a rules-based system. It is suited to those exploring intraday mean-reversion concepts and how a hedging mechanism attempts to manage the failure case, rather than anyone seeking a hands-off solution.
How It Works
The strategy evaluates structural logic once per newly closed bar on a single primary timeframe, while managing any open hedge on every tick. Here is the plain-English breakdown:
Building blocks the strategy calculates first:
- VWAP is re-anchored at the start of each new calendar day and accumulated using the typical price
(High + Low + Close) / 3, weighted by tick volume, over closed bars only. - avgRange is the average of
(High − Low)across theRangeLookbackbars — this acts as the strategy's volatility unit, scaling every other threshold.
Entry conditions for a long fade (the strategy signals a buy when all are true):
- Stretch (required): the just-closed bar's close is at least
StretchMult × avgRangebelow VWAP, indicating price is over-extended to the downside. - Engulfing (required): the just-closed bar is a bullish engulfing candle whose body fully engulfs the prior bearish bar's body.
- Confirmation (at least one of two): a recent bearish (downward) fair-value gap exists in the thrust direction, or the signal bar tags the swing support level within the
SrBufferproximity.
Entry conditions for a short fade (mirror image):
- The close is at least
StretchMult × avgRangeabove VWAP. - The just-closed bar is a bearish engulfing candle.
- A recent bullish (upward) fair-value gap exists, or the signal bar tags swing resistance.
Stop-loss logic:
- For longs, the stop is placed below the lower of the last two bar lows, minus
StopMult × avgRangeof structural padding. - For shorts, the stop is placed above the higher of the last two bar highs, plus the same padding.
- If the structural stop is closer than the broker's minimum stop distance, it is widened to that minimum.
Take-profit logic:
- The take-profit is set at
RewardRatio × risk, where risk is the distance between entry and stop. This targets a move back toward — or through — VWAP.
The recovery hedge:
- New fades are only sought when the account is completely flat (no fade and no hedge open).
- If the lone fade runs
HedgeTriggerMult × avgRangeagainst the entry, and no hedge yet exists, the strategy fires one opposite market leg sized atHedgeVolMult ×the fade lots, with its own stop and a breakout continuation target. - If price instead reverts (the adverse excursion shrinks below 40% of the trigger) before the hedge reaches its target, the hedge is cut early so the original fade can run toward its profit target.
- A
MaxSpreadPointsfilter blocks new fades whenever the spread is wider than the allowed threshold.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| RangeLookback | 20 | 10 | 60 | Number of bars used for the volatility unit (avgRange) and the swing support/resistance window. |
| StretchMult | 1.50 | 0.50 | 4.00 | How far (in avgRange units) price must stretch from VWAP to qualify a fade. |
| FvgLookback | 5 | 2 | 15 | How many recent three-bar windows to scan for a fair-value gap (imbalance). |
| SrBuffer | 0.25 | 0.00 | 1.50 | Proximity (in avgRange units) for the signal bar to count as "at" support or resistance. |
| StopMult | 0.80 | 0.20 | 3.00 | Structural stop padding beyond the signal swing, in avgRange units. |
| RewardRatio | 1.60 | 0.50 | 5.00 | Take-profit distance as this multiple of the entry's risk distance. |
| HedgeTriggerMult | 1.20 | 0.30 | 4.00 | Adverse run (in avgRange units) that arms the recovery hedge. |
| HedgeVolMult | 1.00 | 0.50 | 3.00 | Recovery hedge volume as this multiple of the fade lots. |
| MaxSpreadPoints | 30 | 0 | 500 | Skip new fades while the spread (in points) is wider than this (0 = off). |
| Lots | 0.10 | 0.01 | 1.00 | Base trade volume for the fade leg. |
| Magic | 7720 | 0 | 9,999,999 | Unique magic number identifying this EA's positions. |

Recommended Chart Settings
This strategy operates on a single primary timeframe and re-anchors VWAP each calendar day, so it is designed with intraday charts in mind — commonly the M5, M15, or M30 timeframes, where a meaningful number of bars accumulate within one VWAP session. It can be studied on liquid forex majors (for example EUR/USD or GBP/USD) where spreads are tight and VWAP behaves smoothly. Because the logic scales everything from avgRange, it adapts to each symbol's volatility, but you should still test it carefully on any instrument before relying on it. Remember that results will vary significantly across different market conditions, sessions, and brokers.
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
Strengths of this approach. The strategy is conceptually clean: it relies on transparent price-action logic rather than lagging indicators, which makes it easier to study and reason about. The multi-factor confirmation (stretch, engulfing, plus either a fair-value gap or a swing-level tag) is designed to filter out weak signals. Anchoring everything to avgRange means thresholds scale with current volatility, and the structural stop sits beyond genuine swing points rather than at an arbitrary fixed distance.
Known limitations. Mean-reversion fades have a well-documented failure mode: trending or breakout days, where price keeps moving away from VWAP instead of reverting. The hedge is the strategy's answer to this, but hedging adds its own complexity — it doubles exposure at the worst possible moment and depends on the breakout following through to its target. Note also that some brokers operate in netting rather than hedging mode, which can prevent simultaneous opposite positions; confirm your account type before relying on the hedge leg.
Where it may underperform. Choppy ranges that never stretch far enough from VWAP may produce few signals, while strong directional sessions can repeatedly trigger fades against the trend. News-driven volatility spikes can also distort VWAP and widen spreads beyond the filter's tolerance. Treat this EA as a framework for learning how these conditions interact, not as a finished solution.
Risk Management Tips
- Position sizing: keep the
Lotsvalue small relative to your account, and remember that the hedge can add further exposure viaHedgeVolMult. - Risk per trade: a common educational guideline is to risk no more than 1–2% of account equity on any single position.
- Demo first: always run the strategy on a demo account across varied market conditions before considering any live use.
- Understand drawdown: study how the strategy behaves during losing streaks and trending days, and make sure the worst-case sequence of losses is one you could tolerate.
- Review settings regularly: parameters that suit one symbol, timeframe, or volatility regime may behave very differently in another.
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: VwapImbalanceFadeHedge.ex5 (1 downloads)
- Source Code: VwapImbalanceFadeHedge.mq5 (2 downloads)
- Documentation: VwapImbalanceFadeHedge.pdf (3 downloads)