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 Accumulative Swing Index Breakout is a trend-breakout Expert Advisor built around J. Welles Wilder's Swing Index (SI) and its running total, the Accumulative Swing Index (ASI) — an indicator-driven approach to breakout trading rather than a raw price-level one. Wilder designed the Swing Index to score how much of each bar's movement represented genuine directional commitment, using the geometry of the open, close, prior close and true range. Summing every bar's Swing Index produces the ASI, a smoothed "true price" line that filters out the thin, gappy, small-bodied pokes that make ordinary price breakouts so noisy.
The core idea is straightforward: instead of asking "did price break a level?", the strategy asks "did the accumulated directional conviction break a level?" When the ASI climbs to a fresh multi-bar high while sitting above its own trend baseline, the strategy reads that as an established up-regime and signals a long. The mirror image — a fresh ASI low beneath its baseline — signals a short. This makes it a momentum/trend-following system designed for markets that are transitioning out of consolidation into a directional move.
As a learning tool, this EA is well suited to traders who want to study how a classic Wilder indicator can be repurposed as a breakout engine. It is a good example of applying a Donchian-channel breakout concept to a derived series (the ASI) rather than to price itself. It is best viewed as a strategy to analyze, backtest, and understand — not as a shortcut to returns.
How It Works
The strategy acts once per newly closed bar on a single primary timeframe. On each new bar it recalculates the Swing Index from the just-closed bar and the one before it, adds that value to the running ASI total, and then evaluates its breakout logic.
Entry conditions — the strategy signals a long when:
- The current ASI value prints a fresh N-bar high — it exceeds the highest ASI reading of the previous
BreakoutLookbackbars (a Donchian-style breakout applied to the ASI's own range). - The ASI is simultaneously above its own EMA (Exponential Moving Average — a smoothed trend baseline computed on the ASI itself), confirming an established up-regime.
The strategy signals a short when:
- The current ASI value prints a fresh N-bar low, falling below the lowest ASI reading of the previous
BreakoutLookbackbars. - The ASI is at the same time below its own EMA, confirming a down-regime.
Exit conditions:
- Stop-loss: Placed at a distance of
AtrStopMult × ATRfrom the entry price. ATR (Average True Range) measures recent volatility, so the stop automatically widens in volatile conditions and tightens in quiet ones. - Take-profit: Placed at
RewardRisk × (stop distance)from entry. With the default settings, the target is 1.8 times the risk distance. - Structural early exit: If an opposite ASI breakout occurs while a trade is open — for example, a fresh ASI low appears while you are long — the strategy closes the position immediately. This treats a reversal in accumulated conviction as a reason to step aside rather than wait for the stop.
- No stacking: While a position is open, the strategy will not add new trades; the stop-loss, take-profit, or opposite-breakout exit manages the rest.
Long entries are filled at the Ask price and short entries at the Bid, with both the stop and target normalized to the symbol's digit precision.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| BreakoutLookback | 20 | 8 | 60 | Lookback in bars for the ASI Donchian breakout. A fresh N-bar ASI extreme is the trigger. Larger values demand a more decisive break. |
| AsiTrendPeriod | 10 | 3 | 40 | EMA period applied to the ASI itself. The ASI must sit on the breakout side of this EMA, acting as a regime filter. |
| AtrPeriod | 14 | 5 | 40 | ATR period used to measure volatility for stop and target distances. |
| AtrStopMult | 2.00 | 0.50 | 5.00 | Stop-loss distance as a multiple of ATR from the entry price. Higher values give the trade more room. |
| RewardRisk | 1.80 | 1.00 | 4.00 | Take-profit distance expressed as a multiple of the stop distance (the reward-to-risk ratio). |
| Lots | 0.10 | 0.01 | 1.00 | Fixed position size in lots per trade. |
There is also a Magic number input (default 1001) that tags the EA's orders so it can manage only its own positions.

Recommended Chart Settings
This EA is designed to run on a single primary timeframe and evaluates one closed bar at a time. Because the Swing Index and ASI are built from open/close/high/low geometry, they behave most cleanly on liquid instruments with tight spreads — major forex pairs such as EUR/USD or GBP/USD are natural candidates for study, though the logic is symbol-agnostic.
A common starting point for breakout-style systems is the H1 (1-hour) or H4 (4-hour) timeframe, which balances signal frequency against noise. Lower timeframes generate more signals but also more false breakouts; higher timeframes produce fewer, slower signals. There is no universally "correct" setting — results will vary considerably across different symbols, timeframes, and market conditions, so treat any configuration as a hypothesis to be tested rather than a recommendation. Always backtest and forward-test on a demo account before drawing conclusions.
How to Install on MetaTrader 5
- Download the
AccumulativeSwingIndexBreakout.ex5file 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 of the approach. Filtering breakouts through the ASI is a genuinely elegant idea: because the Swing Index discounts wick-heavy, low-conviction bars, the ASI can smooth out the whipsaw pokes that trigger false signals on raw price channels. The dual-gate design — requiring both a fresh ASI extreme and agreement with the ASI's own EMA — adds a regime filter that historically helps avoid taking breakouts against the prevailing direction. ATR-based stops and the opposite-breakout exit give the system a coherent, volatility-aware risk framework.
Known limitations. Breakout systems of every kind tend to struggle in range-bound, choppy markets, where prices repeatedly break a level and then reverse. In such conditions the ASI can oscillate around its EMA and produce a string of small losing trades. The ASI is also a running cumulative series, so its absolute level drifts over long periods; the strategy sidesteps this by only ever comparing the ASI to its own recent history, but you should still expect behavior to depend on the chosen lookback. Because the EA acts only on closed bars, entries occur after a move has begun, which is the inherent trade-off of any confirmation-based breakout method.
Where it may underperform. Tight, low-volatility ranges, heavily news-driven spikes, and instruments with wide or unstable spreads can all degrade signal quality. The fixed lot size means position risk in currency terms changes as the ATR-based stop distance changes, so the actual money at risk per trade is not constant. Understand these behaviors thoroughly in testing before considering any live use.
Risk Management Tips
Sound risk management matters far more than any single entry rule. 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. Because this EA uses a fixed lot size rather than equity-based sizing, you may need to adjust
Lotsto keep per-trade risk within that band for your account. - Understand your drawdown tolerance. Even a well-designed trend system can produce long strings of losses during ranging markets. Know how large a peak-to-trough decline you could withstand before you begin.
- Always start on a demo account. Forward-test the strategy in a risk-free demo environment until you understand how it behaves across different sessions and market regimes.
- Account for spread and slippage. Breakout entries often fire during fast markets where spreads widen; factor realistic trading costs into any evaluation.
- Never trade with money you cannot afford to lose, and treat backtest results as a study aid, not a forecast.
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: AccumulativeSwingIndexBreakout.ex5 (33 downloads)
- Source Code: AccumulativeSwingIndexBreakout.mq5 (32 downloads)
- Documentation: AccumulativeSwingIndexBreakout.pdf (36 downloads)