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 Structure Shift Continuation strategy is a pure price-action Expert Advisor (EA) for MetaTrader 5 built around the ICT concept of a Break of Structure (BoS) — a moment when price decisively pushes past a confirmed swing point and signals that the prevailing order flow is continuing. Unlike most automated systems, it uses no indicators at all: no moving averages, no RSI, no ATR. Instead, it reads market structure directly from the candles by locating confirmed fractal swing pivots (swing highs and swing lows) and anchoring every decision to those levels.
The core idea is that a market trends through a repeating rhythm of higher highs and higher lows (or lower lows and lower highs). When a candle closes beyond the most recent confirmed swing — and does so with displacement, meaning a strong, full-bodied candle rather than a weak nudge — the strategy interprets this as confirmation that momentum is carrying the trend forward. It then enters in the direction of that break, a style traders call trend continuation or momentum breakout trading.
This makes the Structure Shift Continuation EA most relevant as a learning tool for traders studying smart-money concepts, market structure, and breakout logic. It is best suited to those who want to see how a discretionary price-action idea can be translated into mechanical, rule-based code — and who want to study how structural stop placement behaves — rather than to anyone seeking a hands-off system. Treat it as a study of how structure-based entries are defined, not as a shortcut.
How It Works
The strategy processes the chart once per closed candle, ignoring the still-forming bar so that every decision is based on finalized data. Here is the step-by-step logic:
- Mapping structure (fractal pivots): The EA scans for confirmed swing points using a symmetric fractal lookback. A candle is a swing high only if its high is strictly above the highs of a set number of bars on both sides of it; a swing low works the same way with lows. Because confirmation requires bars on the right side too, a pivot is only "locked in" after the lookback window has fully formed.
- Tracking the last confirmed swing: The most recent confirmed swing high and swing low are stored as the active structural reference levels. Each level is flagged as either "available" or "already broken."
- Bullish entry signal: The strategy signals a long when the just-closed candle closes above the last confirmed swing high, the candle is bullish (close above open), and its body fills at least the displacement percentage of the candle's full range. This combination is read as a decisive break of structure to the upside.
- Bearish entry signal: Mirror image — the strategy signals a short when the just-closed candle closes below the last confirmed swing low, the candle is bearish, and the body meets the same displacement threshold.
- One break per level: Once a swing level is broken, it is marked as used. No new signal can fire in that direction until a fresh pivot forms. This "wait for new structure" rule is designed to reduce repeated signals during choppy, sideways conditions.
- Stop-loss logic: For a long, the stop is placed just below the last confirmed swing low, offset by a buffer measured as a fraction of the signal candle's range. For a short, the stop sits just above the last confirmed swing high, plus the same buffer. Stops are therefore anchored to real structure, not a fixed pip distance.
- Take-profit logic: The distance from entry to stop defines one unit of risk (R). The take-profit is set at a fixed risk-reward multiple of that distance — so if risk is 30 pips and the multiple is 2.0, the target sits 60 pips away.
- One position at a time: While a trade is open, no new orders are placed; the structural stop and target are left to manage the position to completion.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| SwingLookback | 3 | 2 | 8 | Number of bars required on each side of a pivot to confirm a fractal swing high or low. Larger values demand more significant, slower-forming swings. |
| DisplacementBodyPct | 0.55 | 0.30 | 0.80 | Minimum candle body as a fraction of total range for a break to count as "displacement." Higher values require stronger, more decisive breakout candles. |
| RiskReward | 2.0 | 1.0 | 4.0 | Take-profit distance expressed as a multiple of the stop distance (risk). A value of 2.0 targets twice the risked amount. |
| SlBufferFrac | 0.25 | 0.0 | 1.0 | Extra stop-loss padding beyond the protective swing, measured as a fraction of the signal candle's range. |
| Lots | 0.10 | 0.01 | 1.0 | Fixed trade volume (lot size) used for every order. |

Recommended Chart Settings
The Structure Shift Continuation EA was designed as a clean intraday-to-swing structure system and works most naturally on the major forex pairs (for example EUR/USD or GBP/USD) on the H1 (1-hour) timeframe, where fractal swings tend to be well-defined and displacement candles are meaningful. The logic is symbol- and timeframe-agnostic, so you may study it on other instruments and periods, but the character of the signals will change: lower timeframes produce more frequent but noisier breaks, while higher timeframes produce fewer, slower-developing structure shifts. Results will vary across different market conditions, sessions, and instruments, so treat any specific chart as a starting point for your own study rather than a fixed recommendation.
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
What to Consider Before Using This EA
Strengths. The strategy's biggest appeal is its transparency. Because it relies purely on price action and confirmed structure, there are no lagging indicator calculations to second-guess — every entry can be traced back to a specific swing and a specific breakout candle. Anchoring stops to real swing points (rather than an arbitrary fixed distance) is a sound, widely taught principle, and the fixed risk-reward target enforces a disciplined exit plan. The "one break per swing" rule is a thoughtful filter that historically helps avoid re-entering on the same exhausted level.
Known limitations. Breakout-continuation systems are, by nature, vulnerable to false breaks — candles that close beyond a swing with displacement but then immediately reverse. In ranging or low-volatility markets, structure shifts can repeatedly fail, and the strategy may give back gains through a series of small losses. The displacement filter reduces but does not eliminate this. Because the EA waits for a fully confirmed pivot (including bars on the right side), there is an inherent lag between the true turning point and the signal, meaning entries can occur later than a discretionary trader might prefer. The fixed lot size also means risk in account-currency terms changes with each trade's stop distance, since stops are structural rather than constant.
Where it may underperform. Tight, sideways consolidation, major news spikes, and instruments with erratic spreads can all degrade the quality of fractal structure and produce whipsaw signals. This is a tool for studying trending behavior; it is not designed to thrive in every regime.
Risk Management Tips
Sound risk management matters far more than any single entry rule. Consider these general principles as you study this EA:
- Risk a small, fixed fraction per trade. Many educators suggest risking no more than 1–2% of account equity on any single position. Because this strategy uses structural stops of varying width, you may need to adjust the
Lotsvalue per setup to keep that percentage consistent. - Always start on a demo account. Run the EA in a risk-free simulated environment first so you can observe how it behaves across different sessions and market conditions before any real capital is involved.
- Understand drawdown. Even a logically sound strategy can experience losing streaks. Know the maximum peak-to-trough decline you are willing to tolerate, and size positions so that a normal losing run does not threaten your account.
- Account for costs. Spreads, commissions, and slippage on breakout entries can meaningfully affect outcomes, especially on lower timeframes.
- Avoid over-optimization. Tuning parameters until a backtest looks perfect often produces curve-fitted settings that fail on new data. Favor robust, sensible values over fragile "optimal" ones.
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: StructureShiftContinuation.ex5 (3 downloads)
- Source Code: StructureShiftContinuation.mq5 (0 downloads)
- Documentation: StructureShiftContinuation.pdf (1 downloads)