Blog / Strategy
Strategy

Count Back Line Pullback

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 Count Back Line Pullback strategy is an automated, trend-following pullback system built around Daryl Guppy's classic Count Back Line (CBL) — a purely structural, volatility-adaptive re-entry tool. Instead of relying on a smoothed indicator to tell you when a trend has resumed, the CBL is drawn directly from the price swing itself: it counts a fixed number of successive higher-high (or lower-low) bars away from a recent pullback extreme and uses that level as a precise re-entry trigger. This makes it a structure-based trend-continuation strategy rather than a momentum-oscillator one.

The approach is designed for markets that are already trending but have paused to pull back — the natural "breathe in" that happens inside every sustained move. When the pullback finishes and price resumes in the trend direction, the CBL provides a clean, tight, low-risk entry point. To keep the strategy from taking every minor wobble, it layers a slow Exponential Moving Average (EMA) trend filter on top: trades are only considered when the EMA is sloping in the trade direction and price sits on the correct side of it.

As a learning tool, this strategy is well suited to traders who want to understand how discretionary swing-trading concepts — pivots, higher highs, structural stops — can be encoded into rules a machine can follow objectively. It is intended for liquid instruments such as FX majors (EUR/USD, GBP/USD), metals, or indices on intraday-to-swing timeframes. Treat it as a framework for studying pullback entries and disciplined risk placement, not as a shortcut to results.

How It Works

The strategy evaluates its logic once per newly closed bar (it never acts on the still-forming bar, which avoids repainting). It trades one position at a time and maintains fully distinct long and short logic. Here is the long case — the short case is a mirror image using pullback highs and lower lows.

Entry conditions (long example):

Stop-loss logic:

Take-profit logic:

Trade management:

The Average True Range (ATR) — a measure of recent volatility — is used throughout to scale the break margin, the stop buffer, the target, and the breakeven distance, so every threshold adapts to current market conditions rather than using fixed pip values.

Count Back Line Pullback EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
PivotLookback 20 6 60 Number of closed bars searched to find the pullback pivot (the recent swing extreme).
CountBars 3 2 5 Number of successive higher-highs (long) / lower-lows (short) that define the Count Back Line.
TrendPeriod 100 20 250 Period of the slow EMA that defines the tradable trend regime.
SlopeLookback 5 2 20 Bars back used to measure the slow EMA's slope direction.
AtrPeriod 14 7 28 Period of the ATR used to scale breaks, stops, targets, and breakeven.
BreakBufferAtr 0.10 0.00 1.00 Decisive-break margin: the crossing close must clear the CBL by this × ATR.
StopBufferAtr 0.30 0.00 1.50 Extra ATR buffer placed beyond the pivot for the structural stop.
TpAtrMult 3.00 0.50 8.00 Take-profit distance as a multiple of ATR.
BreakevenAtr 1.00 0.00 3.00 Move (× ATR) in favour before the stop is pulled to entry.
Lots 0.10 0.01 1.00 Trade volume in lots.
Magic 7314 0 9,999,999 Magic number used to identify this EA's positions.
Count Back Line Pullback EA — MQL5 source code

Recommended Chart Settings

The Count Back Line Pullback EA is designed to run on a single primary timeframe — whatever timeframe you attach it to. It reads all its bars from the chart's own period, so there is no hidden multi-timeframe dependency. It is best suited to liquid FX majors such as EUR/USD or GBP/USD, and also works conceptually on metals or indices, on timeframes ranging from M15 to H4.

Because the strategy depends on clean, sustained trends with orderly pullbacks, its behaviour will vary considerably across different market conditions. A pair that is ranging or whipsawing will produce very different results than one in a steady trend. Always test any symbol and timeframe combination thoroughly before considering live use.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of this approach. The Count Back Line is a genuinely elegant idea: it derives its trigger from the actual swing structure rather than from a lagging indicator, so entries tend to be tight and the accompanying stop is naturally close. The fresh-cross requirement discourages chasing, and the EMA trend gate keeps the system aligned with the dominant direction. The breakeven ratchet and trend-flip exit are sensible protections that aim to keep individual losses small and bounded.

Known limitations. No structural pullback method escapes the fundamental weakness of trend-following: it needs a trend. In choppy, sideways, or news-driven markets, the EMA slope can flip back and forth, generating entries that are stopped out or exited quickly. The tight structural stop that makes winners efficient can also mean a slightly wider pullback than expected takes the trade out just before the move continues. The CountBars and PivotLookback settings materially change how "deep" a pullback must be before a signal appears — too tight and you catch noise, too loose and you enter late.

Where it may underperform. Expect weaker behaviour during low-volatility consolidations, during high-impact news spikes that blow through structural levels, and on illiquid or heavily spread instruments where the ATR-scaled buffers may not reflect true execution costs. This strategy is a study in disciplined pullback entries — it is not a solution for every market regime.

Risk Management Tips

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