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?
Fair Value Gap Stride is a price-action momentum strategy built around the fair value gap (FVG) — a three-candle pattern where a fast middle candle moves so quickly that the first and third candles never overlap, leaving an untraded "vacuum" of price behind it. The strategy uses no traditional technical indicators. Instead, it reads raw candle geometry to detect when several of these gaps line up in the same direction, a condition it calls a "stride." Its trading style is trend / momentum continuation breakout: it enters into strength rather than waiting for a pullback.
The core idea is that a single fair value gap is often just noise, but a stack of same-direction gaps printed in quick succession signals genuine one-sided order flow. When two or more bullish (or bearish) FVGs form inside a short window and none of them has been filled, the market is "striding" — leaving a ladder of imbalances behind a strong displacement leg. Historically, such legs tend to extend further before price comes back to rebalance them, and that tendency is what the strategy attempts to exploit.
This approach is best understood as a learning tool for traders who want to study order-flow concepts, displacement, and imbalance in a fully mechanical, rules-based form. It is deliberately the opposite of the more common "gap-fill" entry, where traders wait for price to dip back into a gap. Because it enters at market the moment the newest stacked gap completes, it suits students who want to see how a momentum-continuation system behaves on liquid instruments. It was designed with GBP/USD and XAU/USD (gold) on intraday timeframes in mind, but the logic applies to any liquid symbol.
How It Works
The strategy evaluates the market once per freshly closed bar and holds only one position at a time. Every threshold is scaled to current volatility using a plain average candle range over a recent window, so the rules adapt as conditions change. Here is how the logic flows:
- Volatility baseline: The strategy first measures the average high-to-low range across the last
LookbackRangeclosed candles. This average is used to size the minimum impulse, minimum gap, and stop buffer — nothing is hard-coded in pips. - Detecting a single gap: A bullish fair value gap exists when the oldest candle's high sits below the newest candle's low (an up-vacuum), the middle candle closes bullish, the middle candle's body is at least
ImpulseFactor× average range (a real thrust, not a drift), and the gap itself is at leastMinGapFactor× average range. The bearish case is the exact mirror. - Checking the gap is still open: A gap only counts toward the stride if no candle has since closed beyond its base edge. If price has already closed back through a gap, that imbalance is considered "filled" and is excluded.
- Confirming the stride: The strategy requires the newest gap to complete on the just-closed bar, then scans backward across
StackWindowbars and counts how many same-direction, still-intact gaps it finds. If that count reachesStackCountor more, the stride is confirmed. - Entry signal: When a bullish stride is confirmed, the strategy signals a market buy at the ask. When a bearish stride is confirmed, it signals a market sell at the bid. There is no waiting for a retracement — the entry is into the existing momentum.
- Stop-loss logic: For a long, the stop is placed just below the lowest base edge of the entire gap ladder, minus a buffer of
BufferFrac× average range. For a short, it sits just above the highest base. This means the trade is only invalidated if the whole stride is mitigated at once, rather than on a single shallow wick. - Take-profit logic: The target is a fixed multiple of the measured risk. The distance from entry to stop is multiplied by
RiskRewardand projected in the trade's direction, giving a consistent reward-to-risk ratio on every position.
In short, the strategy signals an entry only when stacked, unfilled imbalances suggest sustained displacement, and it defines both its risk and its reward purely from the geometry of those gaps.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| Lots | 0.10 | 0.01 | 1.00 | Fixed order volume in lots for each trade. |
| ImpulseFactor | 1.00 | 0.50 | 3.00 | Minimum middle-candle body, expressed as a fraction of the average range, for the thrust to count as a valid gap. Higher values demand stronger displacement. |
| MinGapFactor | 0.15 | 0.05 | 1.50 | Minimum size of the untraded gap as a fraction of the average range. Filters out trivially small imbalances. |
| StackCount | 2 | 1 | 5 | Minimum number of stacked, still-intact same-direction gaps required to trigger a trade. |
| StackWindow | 6 | 3 | 20 | Number of bars scanned backward when counting stacked gaps. |
| RiskReward | 1.5 | 0.5 | 5.0 | Reward-to-risk multiple used to set the take-profit relative to the stop distance. |
| BufferFrac | 0.20 | 0.00 | 1.00 | Extra stop-loss padding beyond the gap ladder, as a fraction of the average range. |
| LookbackRange | 20 | 10 | 60 | Number of candles used to compute the average range that scales every threshold. |

Recommended Chart Settings
Fair Value Gap Stride was designed for GBP/USD or XAU/USD on the M5 or M15 timeframe, where intraday displacement legs are common and liquidity is high. The volatility-scaled thresholds mean it can technically run on any liquid symbol or timeframe, but the default parameters were tuned with these instruments in mind. Keep in mind that fair value gaps behave differently across asset classes and sessions, so results will vary considerably across different market conditions, instruments, and timeframes. Always study the behavior on a demo account before drawing conclusions.
How to Install on MetaTrader 5
- Download the
FairValueGapStride.ex5file 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
Like every mechanical system, Fair Value Gap Stride has clear strengths and equally clear limitations, and it is worth understanding both before you study it.
Strengths. The logic is transparent and fully rules-based — there are no opaque indicators, so every decision can be traced back to candle geometry you can verify by eye. By stacking multiple unfilled gaps it tries to distinguish genuine displacement from random noise, and its volatility-scaled thresholds let it adapt to changing conditions rather than relying on fixed pip values. The stop sitting beneath the entire imbalance ladder ties the risk directly to the structure that produced the signal.
Limitations. Momentum-continuation entries buy into strength, which means they can enter near the end of an extended move and suffer if price snaps back to fill the very gaps that triggered the trade. The strategy has no trend filter or session filter, so it may signal during choppy, range-bound periods where displacement legs reverse quickly. In low-volatility conditions, gaps may rarely meet the size thresholds, producing long stretches with no trades; in news-driven spikes, slippage and fast fills can widen the real risk beyond the modeled stop. It also trades a single position at a time, so it can sit idle while other opportunities pass.
This is a tool for learning how imbalance and displacement concepts translate into code — not a finished, profitable system. Treat any apparent edge with healthy skepticism and test thoroughly.
Risk Management Tips
Sound risk management matters far more than any single entry signal. Keep these general principles in mind as you study any strategy:
- Risk a small, fixed fraction. Many educators suggest risking no more than 1–2% of account equity per trade, so a string of losses cannot threaten your account.
- Size positions to your stop, not the other way around. Because this strategy's stop distance varies with volatility, the fixed
Lotssetting will not always represent the same monetary risk — calculate your true risk per trade before trading live. - Start on a demo account. Run the EA on a demo for an extended period across different market conditions before considering any real capital.
- Understand drawdown. Even a statistically sound system experiences losing streaks. Know the maximum drawdown you can tolerate emotionally and financially.
- Diversify and avoid over-leverage. Concentrating risk in one instrument or using excessive leverage can amplify losses quickly.
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: FairValueGapStride.ex5 (0 downloads)
- Source Code: FairValueGapStride.mq5 (0 downloads)
- Documentation: FairValueGapStride.pdf (0 downloads)