- Strategy
- Buys when a bar closes more than k × ATR above the previous close and sells when it closes more than k × ATR below it. Trades exit at the stop, the target or after a set number of bars.
- Risk model
- 1% of balance per trade (configurable), ATR-based stop-loss on every order, one position at a time
What it does
ATR Volatility Breakout EA looks for a bar that moves much more than usual. It measures the distance from the previous close in units of ATR, so the same setting adapts to quiet and busy markets. When a close jumps beyond that threshold, the EA joins the move.
How it works
On every new bar the EA uses two closed bars: the signal bar (the last closed bar) and the reference bar (the one before it).
- Levels: reference close ± 1.0 × ATR(14) of the reference bar. Using the ATR known at the reference bar means the level was fixed before the signal bar started.
- Buy: the signal bar closes above the upper level.
- Sell: the signal bar closes below the lower level.
- Stop-loss: 1.5 × the current ATR from entry. Take-profit: 2 × the stop distance.
- Time exit: with the option on, any trade still open after 20 bars is closed at market, whatever its profit or loss.
The idea comes from classic volatility-breakout systems: a range expansion often marks the start of a directional move, and a time stop limits how long capital stays in a trade that goes nowhere. See the lesson on volatility for background on ATR.
How to use it
H4 and D1 suit this logic best because one-bar expansions on low timeframes are often just noise or news spikes. Raising the breakout multiple to 1.5 gives fewer but larger signals. You can turn off the take-profit and rely on the time exit plus a trailing stop if you prefer to let strong moves run. Check the sizing of a 1.5 × ATR stop with the Pip Calculator.
Settings
| Input | Default | What it changes |
|---|---|---|
| ATR period | 14 | Volatility measure |
| Breakout multiple (k) | 1.0 | Size of move needed |
| Stop-loss (x ATR) | 1.5 | Stop size |
| Reward:risk target | 2.0 | Take-profit, 0 disables it |
| Time exit / bars | true / 20 | Maximum holding period |
| Risk per trade / Fixed lots | 1.0% / 0 | Position sizing |
| Max spread (points) | 30 | Spread filter |
| Trading start / end hour | 7 / 20 | Server-time window |
| Break-even / Trailing | on / off | Stop management |
Limitations
Large bars often happen on news, and the next bar can retrace part of the move, so entries at the close of a big bar are exposed to pullbacks. Signals are infrequent on higher timeframes. The time exit can close a trade just before it would have reached its target. Weekend gaps on D1 can make the signal bar's move look larger than it was during trading hours.
Before you run it live
Run it in the Strategy Tester over several years and symbols, compare different breakout multiples, and then on a demo account. On D1 set the trading hours to cover the time of the daily bar change. Keep the risk per trade small. Past behavior does not guarantee future results.

