Blog / Strategy
Strategy

Quantile Band Breakout

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 Quantile Band Breakout strategy is a trend-following breakout system built around a robust quantile channel — a statistical alternative to the classic Donchian channel used in many MetaTrader 5 (MT5) breakout expert advisors. Where a Donchian channel simply tracks the highest high and lowest low over a lookback window (the 100th and 0th percentiles), the Quantile Band Breakout instead computes an upper and lower quantile of recent closing prices — for example the 85th and 15th percentile. Because a quantile ignores the handful of extreme prints at each tail, the resulting channel follows the body of the recent price distribution rather than being defined by a single spike or wick.

That distinction matters. A traditional high/low breakout channel can be dragged wide by one volatile candle, producing false levels and premature signals. A quantile channel is far less sensitive to those outliers, so when price finally closes beyond a band, it reflects a shift in the whole cloud of recent prices — a more meaningful breakout event. The strategy pairs this channel with a compression filter (only breakouts emerging from a tight, coiled range are trusted) and an Average True Range (ATR) based stop-loss and take-profit, where ATR is a common measure of recent market volatility.

This strategy is designed for markets that alternate between quiet consolidation and directional expansion — the classic "coil and break" behavior seen in trending currency pairs. As a learning tool, it is well suited to traders who want to understand how statistical robustness (quantiles versus raw extremes) and volatility filtering can be combined into a systematic breakout framework. It is presented here as a strategy analysis for study, not as a profit opportunity.

How It Works

The strategy evaluates its rules once per completed bar — it waits for a candle to finish before acting, which avoids reacting to noise inside a forming bar. Here is what happens on each new bar:

Positions are tagged with a Magic number so the expert advisor manages only its own trades, and sizing uses a fixed lot value.

quantile band breakout MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
QuantilePeriod 40 20 120 Number of completed closes used to build the quantile channel. Larger values create a smoother, slower channel.
BandProbability 0.85 0.60 0.95 Upper-quantile probability; the lower band mirrors it at 1 − p. 0.85 means an 85th / 15th percentile channel. Higher values push the bands toward the extremes.
CompressionLookback 60 20 200 Lookback window for the average channel width used by the compression filter.
MaxBandWidthRatio 1.00 0.60 1.60 Current channel width must be at or below this multiple of the average width to count as "compressed." Lower values demand a tighter coil before a signal.
AtrPeriod 14 7 30 ATR length used to size the stop-loss and take-profit distances.
AtrSlMult 2.0 1.0 4.0 Stop-loss distance as a multiple of ATR (entry −/+ AtrSlMult × ATR).
AtrTpMult 3.0 1.0 6.0 Take-profit distance as a multiple of ATR (entry +/− AtrTpMult × ATR).
Lots 0.10 0.01 1.0 Fixed lot size for each position.

The parameter set is intentionally small and broadly ranged. Fewer, wider parameters help resist curve-fitting — the tendency to over-tune a strategy so tightly to past data that it fails on new data.

quantile band breakout MT5 EA — MQL5 source code

Recommended Chart Settings

The Quantile Band Breakout is a single-timeframe strategy: every calculation uses the chart's own timeframe, so it runs on whatever period you attach it to. Breakout systems of this type are commonly studied on major forex pairs such as EUR/USD or GBP/USD, on the H1 (1-hour) or H4 (4-hour) timeframes, where the coil-and-expand behavior the strategy looks for tends to be well defined and spreads are typically modest relative to ATR.

That said, there is no universally "correct" symbol or timeframe. The quantile channel, compression filter, and ATR distances will behave differently across instruments and market conditions. If you study this strategy, treat the settings above as a starting point for your own testing and expect results to vary considerably between trending and ranging environments.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The core idea is sound and well-motivated. By using quantiles instead of raw highs and lows, the channel is genuinely more robust to single-bar spikes and wick noise — a real, documented weakness of naïve Donchian breakouts. The compression filter adds a second layer of selectivity, favoring breakouts that emerge from quiet, coiled ranges, which historically tend to precede cleaner directional moves. ATR-based stops and targets adapt the risk geometry to current volatility instead of relying on fixed distances, and the automatic reverse-on-opposite-signal logic keeps the position aligned with the most recent breakout.

Known limitations. Like every breakout method, this strategy is vulnerable to false breakouts — price closing beyond a band and then snapping back into the range. The compression filter reduces but does not eliminate these. In choppy, directionless markets, a breakout system can suffer a string of small losses as it is repeatedly stopped out. The quantile calculation also uses closing prices only, so intrabar spikes that never close beyond a band are ignored — a deliberate design choice that trades some responsiveness for robustness. Finally, fixed-lot sizing means position size does not scale with account equity or volatility.

When it may underperform. Extended range-bound conditions, low-volatility drift, and news-driven whipsaws are the classic environments where breakout strategies struggle. A wide-then-narrow channel that never truly compresses may also starve the strategy of qualifying signals for long stretches. The strategy is best understood as one tool among many, appropriate for study of how statistical channels and volatility filters interact — not as a standalone solution.

Risk Management Tips

Sound risk management matters far more than any single entry rule. Whatever strategy you study, keep these general principles in mind:

Education, patience, and disciplined risk control are what separate durable learning from costly experimentation.

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

← Back to Blog