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 Two Leg Pullback Continuation strategy is a pure price-action, trend-continuation system built around the classic two-legged pullback (often described as an A-B-C correction) that many professional discretionary traders watch for. Unlike most automated systems, it uses no indicators, oscillators, moving averages, or volume — every decision is derived from raw OHLC (open, high, low, close) data, confirmed swing pivots, and market structure. A swing pivot is simply a local high or low that stands out from the bars around it, and market structure refers to the sequence of higher highs/higher lows (uptrend) or lower highs/lower lows (downtrend) that price prints over time.
The core idea is rooted in how corrections tend to behave. A single pullback against a trend can easily keep extending and turn into a full reversal. A measured correction that unfolds in two distinct legs — for example, down, up, then down again inside an uptrend — tends to exhaust the counter-trend pressure more thoroughly. Historically, when the dominant trend resumes after such a two-leg correction, the move can be structurally cleaner than after a simple single-pullback or break-of-structure entry. That nuance is what distinguishes this approach from a basic momentum or breakout system.
This strategy is best understood as a learning tool for traders who want to study market structure, swing detection, and trend continuation in a rules-based way. It is well suited to students of price action who want to see how a discretionary concept can be translated into precise, mechanical conditions. It is not a shortcut, and it is not designed for any particular profit outcome — it is a framework for analysing how trends pause and resume.
How It Works
The strategy continuously rebuilds market structure from closed bars, identifies a qualifying pattern in the last five alternating swing points (labelled a, b, c, d, e), and then waits for a live price trigger to confirm that the trend is resuming.
Swing detection (market structure):
- A swing high is confirmed only when its high is strictly higher than the highs of
SwingLenbars on each side; a swing low mirrors this rule for lows. This symmetric "fractal window" filters out minor noise. - Detected pivots are collapsed into a strictly alternating high/low sequence (newest last). When two same-type pivots appear in a row, only the more extreme one is kept.
Long (buy) setup — sequence low, high, low, high, low:
a= the low that starts the impulse,b= the impulse high,c= the first pullback low,d= a lower high (a bounce that fails),e= the second pullback low.- The strategy signals a valid setup when b is greater than d (the corrective bounce is a lower high) and e is greater than a (the second low is a higher low, so uptrend structure is still intact).
- Trigger: when live price reclaims the lower high
d, the correction is treated as failed and the strategy signals a long entry.
Short (sell) setup — mirror image, sequence high, low, high, low, high:
a= the impulse-start high,b= the impulse low,c= the first bounce high,d= a higher low (a dip that fails),e= the second bounce high.- The strategy signals a valid setup when d is greater than b (the corrective dip is a higher low) and e is less than a (the second high is a lower high, so downtrend structure is intact).
- Trigger: when live price breaks below the higher low
d, the strategy signals a short entry.
Entry confirmation:
- The trigger level is padded by a small buffer equal to
EntryBufferPct× the impulse-leg height, so price must move beyond the level rather than merely touch it. - Only one position is allowed at a time, and each detected pattern can be traded only once (it is keyed to the pivot bar of swing
e), so a single setup never re-fires.
Stop-loss logic:
- The stop is placed just beyond the protective swing
e(the last pullback extreme), padded byStopBufferPct× the impulse-leg height. For longs the stop sits belowe; for shorts it sits abovee.
Take-profit logic:
- The target is a fixed reward-to-risk multiple (
RewardRisk) of the structural stop distance. If the measured risk from entry to stop is, say, 30 pips andRewardRiskis 2.0, the target is placed 60 pips away in the trade's direction.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| SwingLen | 2 | 1 | 5 | Fractal half-window for swing detection. A pivot must be more extreme than this many bars on each side. Larger values find bigger, less frequent swings. |
| RewardRisk | 2.0 | 1.0 | 4.0 | Reward-to-risk multiple. The take-profit distance equals this number times the stop distance. |
| StopBufferPct | 0.15 | 0.0 | 0.60 | Extra stop padding as a fraction of the impulse-leg height, placed beyond the protective swing. |
| EntryBufferPct | 0.05 | 0.0 | 0.40 | Entry-trigger padding as a fraction of the impulse-leg height; price must clear the trigger by this margin. |
| Lots | 0.10 | 0.01 | 1.0 | Fixed trade volume (lot size) used for each position. |

Recommended Chart Settings
This strategy is designed as a single-symbol, single-timeframe price-action system and works on the chart you attach it to. Because it relies on clean swing structure, many traders studying this style prefer major forex pairs (such as EUR/USD or GBP/USD) on intraday-to-swing timeframes like H1 or H4, where two-leg corrections tend to be more clearly defined and spreads are relatively tight. The longer the timeframe, the more significant each swing pivot tends to be.
You are encouraged to test the strategy across several symbols and timeframes on a demo account. Results will vary considerably across different instruments and market conditions, and a setting that suits a trending pair may behave very differently on a ranging or choppy market.
How to Install on MetaTrader 5
- Download the .ex5 file 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.
If you prefer to inspect or modify the logic yourself, the TwoLegPullbackContinuation.mq5 source file can be compiled in MetaEditor before deployment.
What to Consider Before Using This EA
Strengths of the approach. Because the system is built entirely on market structure, its logic is transparent and easy to reason about — you can look at any chart and see why a setup did or did not arm. Requiring two corrective legs rather than one is a deliberate filter that, historically, screens out many shallow pullbacks that fail. The fixed reward-to-risk target and structure-based stop give every trade a clearly defined risk profile before entry, which is valuable for studying disciplined trade management.
Known limitations. Pure price-action structure systems depend heavily on the market actually trending. In sideways or choppy conditions, swing pivots can form erratically, producing patterns that look valid but resolve poorly. Fractal swings are also confirmed with a delay — a pivot is only recognised once SwingLen bars have closed on each side — so the structure the strategy reacts to is slightly lagged by design. The trade-once-per-setup rule prevents over-trading but also means a strong continuation that retests the same level will not be re-entered.
Where it may underperform. Expect more false signals during low-volatility ranges, around major news releases, and on instruments with wide or variable spreads, since the entry buffer is measured relative to leg height rather than spread. No single parameter set will suit all markets, and a configuration optimised on past data may not behave the same way going forward.
Risk Management Tips
Sound risk management matters far more than any single entry signal. Consider these general principles as part of your education:
- Risk a small, fixed fraction per trade. Many educators suggest risking no more than 1–2% of account equity on any single position, adjusting the lot size accordingly rather than using a flat lot for every account size.
- Understand drawdown. Even a well-structured strategy will experience losing streaks. Study the maximum historical drawdown before deciding whether you could tolerate it emotionally and financially.
- Always test on a demo account first. Run the EA on a demo or very small account long enough to understand how it behaves across trending and ranging conditions before considering anything else.
- Size positions deliberately. Because this EA uses a fixed
Lotsvalue, review it carefully so the resulting risk per trade aligns with your account size and the structural stop distance. - Keep expectations realistic. Treat the strategy as a framework for learning about market structure and trade management, not as a source of certainty.
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: TwoLegPullbackContinuation.ex5 (8 downloads)
- Source Code: TwoLegPullbackContinuation.mq5 (5 downloads)
- Documentation: TwoLegPullbackContinuation.pdf (5 downloads)