RangeBreaker: trading robot for MQL5
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
| Parameter | Value |
|---|---|
| Range window | 30 minutes |
| Stop-loss | middle of the range |
| Take-profit | 2× range width |
| Instrument | US500 |
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.
Pros and cons
- Executes the breakout instantly, without hesitation.
- Channel width adapts to volatility.
- Catches the start of strong moves.
- 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
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.