Blog / Strategy
Strategy

Fair Value Gap Stack Rider

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 Fair Value Gap Stack Rider is a pure price-action strategy built around the Fair Value Gap (FVG) — also called a three-candle imbalance, one of the most discussed ideas in the "smart money" trading community. An FVG is the empty space left on a chart when a strong middle candle pushes price so quickly that the wicks of the candle before it and the candle after it never overlap. Because the strategy reads only raw candle highs, lows, and closes, it uses no technical indicators at all — no moving averages, no oscillators, no lagging filters.

What separates this approach from a basic gap strategy is its central idea: a single Fair Value Gap appears almost everywhere and is mostly noise. The Stack Rider only pays attention when two or more unfilled gaps point the same direction within a short window of bars — a cluster the strategy calls "the stack." A stack is treated as a footprint of genuine institutional displacement, since a truly strong move tends to leave several imbalances behind in quick succession. The strategy then waits for price to pull back into the freshest gap and react before it commits to a trade.

As a learning tool, this strategy suits traders who want to understand displacement, market structure, and continuation entries in a systematic, rules-based way. It is designed for liquid, impulsive markets and timeframes — gold (XAUUSD) or an index on the M5–M15 charts are natural fits — although the code itself is timeframe-agnostic and will run on whatever primary timeframe you select. Treat it as a framework for studying how imbalances and trend continuation interact, not as a profit opportunity.

How It Works

The strategy evaluates the market once per fully closed bar and processes everything from the most recent trio of candles. Here is the logic in plain English:

Fair Value Gap MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lots 0.10 0.01 1.0 Fixed trade volume in lots for each position.
MinDisplacementFactor 1.20 0.8 3.0 How large the middle candle's body must be, as a multiple of average range, to qualify as displacement.
RequiredStack 2 1 4 Minimum number of same-direction unfilled gaps needed to form a valid "stack."
StackWindow 10 3 40 Maximum number of bars allowed between the oldest and newest gap in the stack.
TakeProfitRR 2.00 1.0 5.0 Reward-to-risk multiple used to project the take-profit from the measured risk.
StopBufferMult 0.40 0.0 2.0 Extra cushion beyond the gap cluster edge for the stop, as a multiple of average range.
ExpiryBars 18 4 60 Number of bars after which an unfilled gap is considered stale and removed.
StructureLookback 20 5 60 Bars back used to judge trend by comparing closes.
RangeLookback 14 5 50 Window for the mean high-low range that scales displacement and the stop buffer.
Fair Value Gap MT5 EA — MQL5 source code

Recommended Chart Settings

The Fair Value Gap Stack Rider was designed with liquid, impulsive instruments in mind — XAUUSD (gold) or a major stock index are natural candidates — on the M5 to M15 timeframes, where fast displacement legs commonly leave clusters of imbalances. That said, the code is timeframe-agnostic and runs on whichever primary symbol and timeframe you attach it to. Because the strategy depends on impulsive displacement, its behavior will vary considerably across different instruments and market conditions; quiet, range-bound sessions will produce far fewer qualifying stacks than active, trending ones.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The strength of this approach is its discipline. By demanding a stack of gaps rather than a single one, the strategy filters out much of the noise that makes lonely Fair Value Gaps unreliable, and it only engages on continuation after a pullback and a confirming reaction. Its stops and targets are anchored to actual structure — the gap cluster — rather than arbitrary fixed distances, which keeps risk tied to the trade thesis.

There are real limitations to understand. Fair Value Gaps are a popular concept precisely because they are easy to spot, but popularity does not make them predictive; many gaps never get respected. The "stack" requirement reduces trade frequency, so in slow or choppy conditions the strategy may sit idle for long stretches, and during sharp reversals a continuation entry can be caught on the wrong side as price reverses through the cluster. Because trend is judged by a simple close-versus-close comparison, the structure filter can misread complex or transitional markets. The strategy also clears its gap list after each trade, meaning it deliberately steps back rather than stacking multiple positions. None of these traits are flaws to be hidden — they are trade-offs you should study and test thoroughly before relying on the logic.

Risk Management Tips

Sound risk management matters more than any single entry technique. Consider these general principles as part of your education:

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