Skip to main content
ForexNews24
BreakoutMQL5Intermediate

RangeBreaker: trading robot for MQL5

Author: M. Sokolova, algorithm developer

RangeBreaker is a breakout advisor that automatically enters when price leaves the bounds of a volatility channel.

How the advisor works

The advisor builds a channel a multiple of ATR wide around yesterday’s close and enters in the direction of the break. Automation catches the breakout instantly — where a discretionary trader hesitates over whether the move is real. The channel width adapts to volatility on its own through ATR.

The weak point is false breakouts: in a range price regularly leaves the boundaries and returns, and the advisor executes each such false signal. Breakout robots inherently have a low win rate and live off rare large moves.

Parameters and metrics

Advisor parameters
ParameterValue
Range window30 minutes
Stop-lossmiddle of the range
Take-profit2× range width
InstrumentUS500

Check on real data

The advisor's logic was run on real quotes without fitting parameters to history. The rule tested was "RangeBreaker: volatility channel breakout ±1.5 ATR":

  • Boundaries — yesterday’s close ± 1.5 × ATR(14).
  • Long on a close above the upper boundary, short on a close below the lower.
  • Direction is held until a break the other way.
-0.2%
Return/year (CAGR)
6.8%
Max drawdown
0.00
Sharpe ratio
43%
Winning trades
7
Trades in period
89%
Time in market
9597100102105
AdvisorBuy and hold
Equity curve of the advisor's rule against passive buy-and-hold on the EUR/USD sample, 2025-06-16 — 2026-07-20. On this sample the advisor beat buy-and-hold. This is a result on one instrument over one period — an illustration of the mechanic, not a promise of returns.
How to read this result
A live advisor would add the execution costs of a specific broker to this picture — spread and slippage that are absent from the model run. That is why, before a real account, any EA goes through a forward test on demo: only it reveals the actual execution.
From the authors' review
«The opening range is the market’s collective memory of yesterday’s close compressed into 30 minutes: a break of that memory is statistically significant more often than a random move.»

Pros and cons

Pros
  • Executes the breakout instantly, without hesitation.
  • Channel width adapts to volatility.
  • Catches the start of strong moves.
Cons
  • False breakouts in a range are the main loss.
  • Low win rate.
  • Requires a trending market to pay off.

Pitfalls

The owner of a breakout advisor is undone by impatience: most breakouts are false, and after a series of small losses comes the temptation to switch the robot off — right before the large move it was built for. Breakout systems demand the discipline to hold them through a stretch of losing trades.

Who it suits

For traders automating breakout logic who are ready for a string of small losses in exchange for rare large trends. Requires accepting a low win rate.

Related methodology

Methodology
Day trading

Frequently asked questions

Why does a breakout advisor have so few winning trades?

Most breakouts are false and never develop into a trend. The positive result comes from rare large moves with losses capped by the stop — this is a structural property of the approach.

Why are the channel boundaries built on ATR?

ATR reflects the current average bar range, so the channel widens on a volatile market and narrows on a calm one. A fixed width would produce too many false breakouts in a quiet market.

What did the backtest show?

On a trendless sample, false breakouts dominated and the result is close to zero — a clear demonstration that a breakout advisor needs a trending market.

From research to application

In our Allocation product we implemented these algorithms with all the nuances covered across the portal.

Learn about Allocation