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 Breakout Trend EA is a pure price-action, break-of-structure (BOS) trading system for MetaTrader 5 that uses no technical indicators at all — no moving averages, no RSI, no ATR. Instead, it works entirely from horizontal support and resistance levels that it builds from real swing pivots (the natural peaks and troughs price carves out as it moves). In plain terms, a swing high is a bar that stands taller than its neighbours on both sides, and a swing low is a bar that dips lower than its neighbours on both sides. These pivots become the structural map the strategy reads.
This is a trend-following continuation approach. Rather than fading a level (betting price will bounce off it), the strategy waits for price to break through a level in the direction of the prevailing trend. It determines trend using classic Dow theory market structure: an uptrend is defined by a sequence of higher highs and higher lows, while a downtrend is defined by lower highs and lower lows. Only when structure and breakout agree does the strategy signal a trade.
As a learning tool, Structure Breakout Trend is well suited to traders who want to study how market structure and breakout logic combine without the noise of lagging indicators. Because every level it uses is confirmed by future bars before it is acted upon, the levels never "repaint" (shift after the fact), which makes the logic transparent and easy to follow on a chart. It is best understood as a framework for studying trend continuation — not as a shortcut to results.
How It Works
The strategy evaluates the market once per newly-closed bar and only considers a new trade when no position is already open under its magic number. Here is the logic in plain English:
- Building the levels. The EA scans recent closed bars and marks every confirmed swing high (resistance) and swing low (support). A pivot only qualifies once it has
PivotLeftRightbars on each side that fail to exceed it — the right-hand bars are what "confirm" it, so the level cannot change later. - Defining the trend. The strategy compares the two most recent swing highs and the two most recent swing lows. An uptrend requires the latest swing high to be above the prior one and the latest swing low to be above the prior one (higher highs and higher lows). A downtrend requires the mirror image (lower highs and lower lows).
- Long entry signal. In a confirmed uptrend, the strategy signals a buy when the just-closed bar closes strictly above the most recent swing-high resistance for the first time (the previous bar had not yet closed above it). This is a bullish break of structure in the direction of the trend.
- Short entry signal. In a confirmed downtrend, the strategy signals a sell when the just-closed bar closes strictly below the most recent swing-low support for the first time. This is a bearish break of structure with the trend.
- Stop-loss logic. The stop is structural, not a fixed pip distance. For a long, it is placed just beyond the most recent swing low (the higher-low that defines the uptrend), and for a short, just beyond the most recent swing high (the lower-high that defines the downtrend). A buffer — a fraction of the current swing range — is added so the stop scales naturally to any symbol or timeframe without depending on point size.
- Take-profit logic. The target is a fixed reward-to-risk multiple of that structural stop distance, set by the
RewardRatioparameter. With the default of 2.0, the target sits twice as far from entry as the stop. This is intended to let winners run relative to the risk taken on each trade. - Trade management. The strategy holds one position at a time per magic number and lets the structural stop and target manage the exit — there is no trailing or scaling logic.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| PivotLeftRight | 3 | 2 | 8 | Number of bars required on each side of a bar for it to qualify as a confirmed swing pivot. Higher values produce fewer, more significant levels. |
| StopBufferFrac | 0.10 | 0.00 | 1.00 | Stop buffer placed beyond the structural swing, expressed as a fraction of the current swing range (resistance − support). Larger values give the trade more breathing room. |
| RewardRatio | 2.00 | 1.00 | 6.00 | Take-profit distance as a multiple of the structural stop distance. A value of 2.00 targets twice the risk. |
| Lots | 0.10 | 0.01 | 1.00 | Fixed trade volume in lots per position. |
| Magic | 7401 | 0 | 9,999,999 | Unique identifier so the EA only manages its own trades and can run alongside other strategies. |
Recommended Chart Settings
The strategy was designed for a trending instrument — for example GBPUSD or XAUUSD (Gold) — on the H1 (1-hour) timeframe. This combination suits a swing trend-following style, where confirmed structure has time to develop and the R-multiple target has room to play out. As always, results will vary considerably across different symbols, timeframes, and market conditions. Ranging or choppy markets, in particular, tend to produce false breakouts that this kind of system is more exposed to, so it is worth studying how the logic behaves across several instruments before drawing conclusions.
Historical Backtest Results
Note: The figures below are from a historical backtest simulation. Backtests have inherent limitations — they do not account for slippage, requotes, spread widening, or psychological factors. These results should not be interpreted as a prediction of future performance.
No backtest data is available for this strategy at the time of writing. When a historical simulation has been completed, this section will be updated with the standard performance metrics — Net Profit, Profit Factor, Sharpe Ratio, Win Rate, Maximum Drawdown %, and Total Trades — drawn directly from the simulation report. Until then, no performance figures are presented, and none should be assumed.
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
Like any approach, Structure Breakout Trend has trade-offs worth understanding before you study it on a live or demo account.
Strengths. Because it relies only on confirmed swing pivots, the strategy's levels are objective and do not repaint, which makes its decisions easy to audit on a chart. Requiring both a structural trend and a fresh break of structure is a relatively strict filter, so it tends to avoid trading against an established trend. The structural stop and R-multiple target give every trade a clearly defined, self-scaling risk profile.
Limitations. Breakout systems are vulnerable to false breakouts — price closing beyond a level only to reverse — especially in ranging or low-volatility conditions. Because the strategy waits for a closed-bar confirmation, entries occur after the initial move, which can mean a less favourable entry price when momentum is fast. It also trades only one position at a time and has no re-entry or trailing logic, so a single whipsaw can result in a full stop-out. The fixed lot size means position size does not adapt to account equity or volatility.
Where it may underperform. Sideways, news-driven, or sharply mean-reverting markets are the toughest environment for trend-continuation breakouts. The strategy is designed for instruments that trend cleanly, so applying it to range-bound symbols may produce frequent small losses. Treat it as a framework for studying market structure, and validate its behaviour thoroughly before relying on it.
Risk Management Tips
Sound risk management matters far more than any single entry signal. A few general principles to keep in mind as you learn:
- Risk a small, fixed fraction per trade. Many educators suggest risking no more than 1–2% of account equity on any single position, so that a string of losses does not threaten your capital.
- Size positions to your stop, not the other way around. Because this strategy uses a structural stop that varies per trade, the fixed
Lotssetting means your actual risk in currency terms changes from trade to trade — be aware of this and adjust volume if needed. - Test on a demo account first. Run the EA in simulation or on a demo account long enough to understand its drawdown profile and trade frequency before considering any live use.
- Understand drawdown. Even a sound strategy will experience losing streaks. Knowing the historical maximum drawdown helps you set expectations and avoid abandoning a plan at the worst moment.
- Keep leverage modest. Excessive leverage magnifies both gains and losses and is a common reason accounts fail to survive normal volatility.
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: StructureBreakoutTrend.ex5 (3 downloads)
- Source Code: StructureBreakoutTrend.mq5 (0 downloads)
- Documentation: StructureBreakoutTrend.pdf (1 downloads)