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?
Vacuum Gap Continuation is a pure price-action strategy built around the Fair Value Gap (FVG) — a three-bar imbalance pattern that some traders also call a "price vacuum." It uses no technical indicators at all: there is no moving average, no RSI, and no oscillator. Instead, it reads raw candle geometry to spot the moment when a single powerful candle rips price in one direction and leaves an unfilled gap behind it. This is a limit-order, pullback-continuation trading style, meaning it waits for price to retrace into the gap rather than chasing the breakout.
The core idea is rooted in a well-known market behavior: when one candle expands far beyond the recent average (a "displacement"), it often creates a zone that price skipped over too quickly to trade fairly. Markets frequently revisit that unfilled zone before continuing in the displacement direction. Rather than buying or selling into momentum, Vacuum Gap Continuation parks a resting limit order inside the gap and lets price pull back to fill it, then aims to ride the continuation move.
As a learning tool, this strategy is well suited to traders who want to study Smart Money Concepts (SMC), order-flow imbalances, and the mechanics of limit-order entries. Because every rule is mechanical and visible on the chart, it is a clear way to explore how displacement, gap measurement, and reward-to-risk planning fit together. It is designed for trending or impulsive market conditions and is best understood as a structured framework for analysis — not a profit opportunity.
How It Works
The strategy evaluates the market once per completed bar and tracks only one setup at a time. Here is how it identifies and manages a trade in plain English:
- Reading three bars (A, B, C): The strategy looks at the three most recently closed candles. Bar A is the oldest, bar B is the middle "displacement" candle, and bar C is the newest. Together they may form a Fair Value Gap.
- Measuring displacement: Bar B must be unusually large — its high-to-low range must exceed the recent average candle range multiplied by the
DisplacementMultsetting. The average range is computed inline over theRangeLookbackbars that precede the trio, keeping the method pure price action. - Detecting a bullish gap: A bullish Fair Value Gap exists when bar A's high is below bar C's low (
A.High < C.Low) and the displacement candle closed higher than it opened. The empty zone sits between A's high and C's low. - Detecting a bearish gap: A bearish gap exists when bar A's low is above bar C's high (
A.Low > C.High) and the displacement candle closed lower than it opened. The empty zone sits between C's high and A's low. - Filtering small gaps: The gap must be at least
MinGapFractionof the average candle range, so the strategy ignores trivial imbalances that offer little room to work with. - Entry signal: When a valid gap is found, the strategy places a resting Buy Limit (bullish) or Sell Limit (bearish) order inside the gap. The
FillDepthsetting controls how deep into the void the limit sits — 0.50 places it at the midpoint of the gap. - Stop-loss logic: The stop is placed just beyond the gap's far (distal) edge, with extra room added as a fraction of the gap size set by
StopBufferFrac. If the gap is fully violated, the original premise is gone. - Take-profit logic: The target is set at a multiple of the measured risk, defined by
RewardRisk. With the default of 2.0, the strategy signals a target twice the distance of its stop. - Expiry and invalidation: If the resting order is not filled within
ExpiryBarsbars, it is cancelled. The order is also cancelled if a candle closes through the far edge of the gap, which the strategy treats as the "void" being broken and the setup invalidated. - One setup at a time: Once a position is live, no new orders are sought until the stop-loss or take-profit resolves the trade. This hygiene rule keeps exposure controlled and the logic easy to follow.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| Lots | 0.10 | 0.01 | 1.00 | Order volume in lots for each limit order placed. |
| DisplacementMult | 1.6 | 1.0 | 3.0 | How many times larger than the average candle range the middle (displacement) bar must be to qualify. |
| MinGapFraction | 0.25 | 0.05 | 1.00 | Minimum gap size, expressed as a fraction of the average candle range, required to take a setup. |
| FillDepth | 0.50 | 0.00 | 1.00 | How far into the gap the limit order is placed (0 = near edge, 1 = far edge, 0.5 = midpoint). |
| StopBufferFrac | 0.50 | 0.00 | 2.00 | Extra stop-loss buffer beyond the gap's far edge, as a fraction of the gap size. |
| RewardRisk | 2.00 | 1.00 | 5.00 | Reward-to-risk multiple used to set the take-profit relative to the stop distance. |
| ExpiryBars | 6 | 1 | 30 | Number of bars after which an unfilled resting order is cancelled. |
| RangeLookback | 20 | 5 | 60 | Number of bars used to compute the average candle range for the displacement filter. |

Recommended Chart Settings
Vacuum Gap Continuation is a single-timeframe strategy, so it reads only the chart it is attached to. Fair Value Gaps are most commonly studied on intraday timeframes such as the M15, M30, or H1, where displacement candles and the gaps they leave behind are frequent enough to study but large enough to be meaningful. Liquid markets like major forex pairs (for example EUR/USD or GBP/USD) tend to produce cleaner displacement structures than thinly traded instruments.
The defaults — a displacement multiplier of 1.6, a 20-bar lookback, and a 2:1 reward-to-risk target — are a balanced starting point for experimentation rather than an optimized configuration. Keep in mind that gap behavior differs across symbols, sessions, and volatility regimes, so results will vary considerably across different market conditions. Always study the strategy on historical data and a demo account before drawing conclusions.
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
Every approach has trade-offs, and an honest assessment helps you use this strategy as a learning tool.
Strengths. Because it relies only on price action, the logic is transparent and free of indicator lag — there are no smoothing settings or repainting concerns. The limit-order entry means the strategy aims to enter at a favorable price within the gap rather than chasing momentum, and its built-in expiry and invalidation rules prevent stale orders from lingering. The one-setup-at-a-time design keeps risk simple to reason about.
Limitations. Fair Value Gaps are a popular but imperfect concept. Not every gap gets filled, and not every filled gap leads to continuation — price can retrace through the entire void and reverse, which is why the invalidation rule exists. The displacement filter helps, but in choppy or range-bound conditions the strategy may place orders that never fill, or fill just before a reversal. The fixed reward-to-risk target does not adapt to changing volatility, and during news-driven spikes the gap geometry can be distorted by slippage and widened spreads.
Where it may underperform. Quiet, low-volatility sessions tend to produce few qualifying displacement candles, so the strategy may sit idle. Conversely, violently whipsawing markets can trigger entries that are quickly stopped out. Treat the parameters as variables to study, not as a guaranteed recipe, and observe how the behavior changes across symbols and timeframes.
Risk Management Tips
Sound risk management matters far more than any single entry signal. These are general educational principles to keep in mind:
- Position sizing: Size each trade so that a stop-loss represents only a small, predefined slice of your account — many educators suggest risking no more than 1–2% of equity per trade.
- Test on demo first: Run the strategy on a demo account until you understand how it behaves in different market conditions before considering any live capital.
- Understand drawdown: Even a well-structured strategy will experience losing streaks. Study the historical sequence of wins and losses so you are mentally and financially prepared for periods of drawdown.
- Respect leverage: Leverage magnifies both gains and losses. Use it conservatively and never commit funds you cannot afford to lose.
- Keep records: Journaling each setup — the gap, the displacement, the outcome — turns the strategy into a structured learning exercise rather than a black box.
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: VacuumGapContinuation.ex5 (4 downloads)
- Source Code: VacuumGapContinuation.mq5 (2 downloads)
- Documentation: VacuumGapContinuation.pdf (4 downloads)