Blog / Strategy
Strategy

Gap Anchor Continuation

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 Gap Anchor Continuation strategy is a pure price-action expert advisor (EA) built around a single chart pattern: the price gap. A gap is a visible "jump" between one candle's close and the next candle's open, where price leaps in one direction without trading the levels in between. Unlike many automated systems, this strategy uses no traditional indicators at all — there is no moving average, RSI, ATR, or oscillator anywhere in its logic. Every decision is made from raw candle geometry: opens, highs, lows, and closes.

The trading style here is breakout continuation rather than mean reversion. A gap can behave in two opposite ways: it can act as a magnet that price returns to fill, or as a launch pad that price continues away from. The Gap Anchor Continuation strategy is designed for the launch-pad scenario — it looks for a gap that shows one-sided commitment, then trades in the same direction as the gap once the market confirms that commitment. The "anchor" in the name refers to the gap origin, the price level where the gap began, which the strategy treats as a hard invalidation line.

As a learning tool, this EA is well suited to traders who want to study how gaps, voids, and retests behave on a price chart without the noise of lagging indicators. It rewards patience: the strategy does not chase the explosive gap candle itself. Instead it arms a setup and waits for a controlled pullback into the gap before committing. This makes it a useful study of "wait for confirmation" entry discipline, a concept that applies far beyond gaps alone.

How It Works

The strategy runs on completed bars only — it evaluates conditions once per closed candle and never acts mid-bar. Its lifecycle moves through two stages: first it arms on a qualifying gap, then it waits for a defended retest to enter.

Building the volatility yardstick:

Arming on a qualifying gap (two-bar geometry):

Entering on a defended retest:

Stop-loss logic:

Take-profit logic:

Trade hygiene:

gap anchor continuation 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 Fixed trade volume (position size) in lots per trade.
GapMultiple 0.80 0.20 4.00 Gap size required to arm a setup, expressed as a multiple of the average bar range. Higher values demand larger, rarer gaps.
RangeLookback 20 5 60 Number of bars used to compute the average-range volatility yardstick.
RetestDepth 0.50 0.10 1.00 How deep the pullback must dip into the void, as a fraction of void size, before a retest qualifies.
StopBuffer 0.50 0.10 2.00 Extra distance beyond the gap origin for the stop-loss, as a multiple of average range.
RewardRisk 2.00 1.00 5.00 Take-profit distance as a reward-to-risk multiple of the entry-to-stop risk.
ExpiryBars 8 1 40 Number of bars an armed setup remains valid before it expires unused.
gap anchor continuation EA — MQL5 source code

Recommended Chart Settings

The Gap Anchor Continuation strategy operates on a single timeframe and trades the symbol of whatever chart it is attached to. Because the logic depends on the presence of genuine gaps, it tends to be most relevant on instruments and timeframes where gaps actually occur with meaningful frequency — for example, higher intraday timeframes (such as H1) on instruments that experience session breaks or news-driven jumps, where the open of a new bar can diverge from the prior close.

There is no single "correct" symbol or timeframe. The behavior of gaps varies enormously across markets: a continuously traded forex pair gaps differently from an index CFD that has session opens. You should test the strategy across several symbols and timeframes on historical data to understand where its gap definition produces sensible setups. Results will vary across different market conditions, and a setting that arms frequently on one instrument may rarely trigger on another.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Every approach has trade-offs, and understanding them is part of learning to use any EA responsibly.

Strengths of this approach:

Known limitations:

Where it may underperform:

Risk Management Tips

Sound risk management matters more than any single strategy setting. Consider the following general principles as you study this 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