Blog / Strategy
Strategy

Fair Value Gap Expansion Breakout

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 Expansion Breakout is a pure price-action expert advisor (EA) built around the Fair Value Gap (FVG) — a three-candle imbalance pattern — combined with a momentum-continuation breakout entry. There are no traditional indicators anywhere in this strategy: no moving averages, no RSI, no ATR. Every threshold is measured directly from raw candle geometry (highs, lows, candle bodies, and a simple mean candle range used only to scale buffers). If you are studying how institutional-style "smart money" concepts can be translated into mechanical, rule-based code, this is a clean example to learn from.

A Fair Value Gap is the footprint of a fast, one-sided move. When a strong displacement candle travels so quickly that the wick of the candle before it and the wick of the candle after it never overlap, an untraded "void" of price is left behind. Most traders use FVGs to predict a pullback — they place a limit order at the 50% line of the gap and wait for price to retrace back into the imbalance. The Fair Value Gap Expansion Breakout does the opposite. It assumes that in a genuine runaway expansion, the retrace often never comes, and the strongest moves leave their imbalance unmitigated and keep going.

This makes it a price-action momentum / displacement-continuation breakout strategy. It is designed for trending, expansive market conditions rather than quiet, range-bound sessions. As a learning tool, it suits intermediate traders who already understand candlestick structure and want to see how concepts like displacement, market structure breaks, and stop-entry orders fit together into a single, self-contained system. It is best treated as a study in mechanical rule design — not as a shortcut to results.

How It Works

The strategy acts once per newly closed bar on the chart's timeframe and only ever manages one setup at a time. Here is the logic in plain English.

Building the context:

Bullish entry conditions — the strategy arms a Buy Stop order when all of the following are true:

Bearish entry conditions are the exact mirror: a fresh down-gap, a strong bearish displacement candle, a close below the prior swing low, a gap of sufficient height, and a Sell Stop armed a buffer below the trio's low.

Stop-loss logic:

Take-profit logic:

Order management:

fair value gap breakout 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.00 Order volume in lots. Controls position size per trade.
MinGapFactor 0.25 0.05 1.50 Minimum gap height as a fraction of the mean candle range. Higher values demand a more meaningful imbalance.
MinDisplacementFactor 1.10 0.50 3.00 Required displacement candle body size relative to the mean range. Higher values demand a more violent thrust.
EntryBufferFrac 0.10 0.00 1.00 Stop-entry buffer beyond the trio's extreme, in mean-range units. Avoids triggering on the exact tick.
StopBufferFrac 0.30 0.00 1.50 Protective-stop buffer beyond the gap's far edge, in mean-range units. Gives the stop breathing room.
RiskReward 2.00 1.00 6.00 Take-profit distance as a multiple of the structural stop distance.
StructureLookback 10 3 50 Number of bars before the trio whose swing high/low the displacement must break.
ExpiryBars 6 1 30 Cancel an un-triggered stop order after this many bars.
RangeWindow 20 8 60 Window for the mean candle range that scales every threshold.
Magic 9207 0 9,999,999 Magic number used to identify this EA's own orders and positions.
fair value gap breakout EA — MQL5 source code

Recommended Chart Settings

Because every threshold scales to a mean candle range rather than a fixed point value, the Fair Value Gap Expansion Breakout is symbol-agnostic. It is designed to run on liquid instruments — major forex pairs such as EUR/USD, metals such as XAU/USD (gold), and major stock indices — on intraday timeframes from M5 through H1. These timeframes tend to produce frequent, clearly defined displacement candles while still leaving room for follow-through.

As with any breakout approach, results will vary considerably across different market conditions. The same parameter set that suits a trending session may behave very differently during quiet, choppy, or news-driven periods. Always test a configuration on the specific symbol and timeframe you intend to study before drawing any conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Every strategy involves trade-offs, and an honest assessment is more useful than a sales pitch.

Strengths of this approach:

Known limitations:

Historically, momentum-continuation strategies tend to perform best when a market is genuinely expanding and worst when it is consolidating. No parameter set will suit every regime, and the strategy signals should be understood as conditional, not predictive.

Risk Management Tips

Risk management is the part of trading you can actually control. Consider these general principles as you study any EA:

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