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 Protected Swing Breakout is a pure price-action expert advisor (EA) built around the ICT (Inner Circle Trader) concept of a Break of Structure (BoS), traded entirely from confirmed fractal swing pivots with no technical indicators attached to the chart. Instead of moving averages, oscillators, or other lagging tools, it reads raw candle data — the highs, lows, opens, and closes — to map where the market last formed a meaningful turning point and then waits for price to decisively break through that level.
A fractal swing pivot is simply a high or low that stands taller (or lower) than a fixed number of candles on each side of it. The strategy treats the most recent confirmed swing high as the bullish structural level and the most recent confirmed swing low as the bearish one. When a candle closes beyond one of these levels — not merely wicks through it — the strategy interprets that as structure breaking in a particular direction. To filter out weak, indecisive breaks, it also requires a displacement condition: the breaking candle must be unusually large relative to recent average candle range, echoing ICT's distinction between a genuine break and a shallow liquidity grab.
This makes the Protected Swing Breakout best suited as a learning tool for traders studying market-structure trading and momentum breakouts. It is a structured, rules-based way to explore how concepts like swing pivots, break of structure, and displacement translate into mechanical entry and exit logic. It is not designed as a guaranteed income tool, and it should be approached as a framework for understanding price action rather than a shortcut to results.
How It Works
The strategy makes one decision per closed candle and holds at most one position at a time. Here is how each piece of its logic fits together:
- Mapping structure: On each new closed bar, the strategy looks back
SwingLookbackbars to check whether a candidate candle is a confirmed fractal pivot — a high that dominates every candle within the window on both sides, or a low that does the same. Confirmed highs become the active "protected" swing high; confirmed lows become the protected swing low. - Measuring displacement: It calculates the average candle range over the previous
RangeAvgPeriodcandles. The candle that breaks structure must have a range at leastDisplacementFactortimes that average. This is the momentum filter that rejects timid, low-conviction breaks. - Bullish Break of Structure signal: The strategy signals a long when the newest closed candle is bullish (closes above its open), is displaced, and closes above the last confirmed swing high — provided that exact level has not already been traded. This "no re-entry" rule prevents repeatedly firing on the same structural level.
- Bearish Break of Structure signal: Conversely, it signals a short when the newest closed candle is bearish, is displaced, and closes below the last confirmed swing low, again only if that level is fresh.
- Stop-loss logic: On a long, the stop is hidden just below the protected swing low that anchored the up-leg, minus a small buffer (15% of average range) for noise. On a short, the stop sits just above the protected swing high plus the same buffer. The stop is placed at structure, not at an arbitrary fixed distance.
- Take-profit logic: The distance from entry to stop defines the structural risk (one "R"). The take-profit is set at
RiskRewardRatiomultiplied by that risk. With the default of 2.0, the target sits twice as far from entry as the stop. - Position management: Only one position per magic number is allowed at a time. Once a trade is open, the strategy waits until it closes (by stop, target, or manual intervention) before considering a new signal.
In plain terms, the strategy signals a trade only when price breaks a recently formed structural level with conviction, and it always defines its risk against the swing that protected the move.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| SwingLookback | 3 | 2 | 6 | Number of bars a candle must dominate on each side to be confirmed as a fractal swing pivot. Higher values demand more significant, less frequent swings. |
| RangeAvgPeriod | 14 | 5 | 30 | Number of candles used to compute the average candle range that the displacement filter compares against. |
| DisplacementFactor | 1.3 | 1.0 | 2.5 | The breaking candle's range must be at least this multiple of the average range. Higher values require stronger momentum to trigger an entry. |
| RiskRewardRatio | 2.0 | 1.0 | 5.0 | Take-profit distance expressed as a multiple of the structural risk (stop distance). A value of 2.0 targets twice the risk. |
| Lots | 0.10 | 0.01 | 1.0 | Fixed trade volume in lots used for each position. |

Recommended Chart Settings
The Protected Swing Breakout is a structure-and-momentum strategy, so it tends to be studied on liquid instruments and on timeframes where swing pivots and displacement are meaningful — commonly major forex pairs (for example EUR/USD) on intraday charts such as M15, M30, or H1, where breaks of structure are frequent enough to observe but not dominated by tick noise. Because the logic is symbol-agnostic and reads only price, you can apply it to other markets, but the character of swings and displacement differs greatly between instruments. Results will vary across different market conditions, sessions, and volatility regimes, so treat any timeframe 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
Every approach has trade-offs, and understanding them is part of learning to trade structure.
Strengths. Because it is pure price action, the Protected Swing Breakout has no indicator lag and no curve-fitted signal smoothing — it reacts to what price actually does. Its stops are anchored to real structure rather than fixed pip distances, which means risk is defined by the market itself. The displacement filter is a thoughtful attempt to separate genuine breaks from liquidity grabs, and the fixed risk-reward target enforces disciplined exits.
Limitations. Breakout systems are well known to struggle in ranging, choppy, or low-volatility markets, where price repeatedly pokes through structure without following through — producing a cluster of stopped-out trades sometimes called "whipsaw." The "no re-entry per level" rule reduces over-trading but can also cause the strategy to sit out a move that breaks the same level again with more conviction. A fixed lot size does not scale with account equity or volatility, and a fixed risk-reward ratio may not suit every market regime. The strategy also takes only one position at a time, so it can miss simultaneous opportunities.
The honest summary is that this is a clean, transparent expression of a popular price-action concept — valuable for study — but it is not a complete trading system, and it may underperform in conditions that do not produce clean, momentum-driven breaks.
Risk Management Tips
Sound risk management matters far more than any single entry signal. Keep these general principles in mind as you study any strategy:
- Size positions deliberately. A common educational guideline is to risk no more than 1–2% of your account on any single trade. The fixed
Lotsinput in this EA does not do that automatically, so calculate whether the structural stop distance keeps your monetary risk within that band before trading live. - Use a demo account first. Run the strategy on a demo or simulated account across many different market conditions before risking real capital, so you understand how it behaves in trends, ranges, and news-driven volatility.
- Understand drawdown. Even a well-designed rules-based system will experience losing streaks. Know the maximum drawdown you are willing to tolerate, and recognise that historical behaviour may not repeat.
- Account for costs. Spreads, commissions, and slippage all erode breakout entries, which are placed into fast-moving candles. Factor these into any evaluation.
- Never over-leverage. Leverage amplifies losses as readily as it amplifies any gains. Trade conservatively and only with capital you can afford to lose.
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: ProtectedSwingBreakout.ex5 (4 downloads)
- Source Code: ProtectedSwingBreakout.mq5 (6 downloads)
- Documentation: ProtectedSwingBreakout.pdf (3 downloads)