Join waitlist
Strategies / Breakout / Donchian Breakout With ATR Line Exit

Donchian Breakout With ATR Line Exit

The strategy buys when the close reaches or exceeds the highest high of the prior 20 bars. It sells when the close falls to the lowest low of the prior 10 bars or below a volatility line built from true range.

BreakoutLong onlySwingNasdaq 100Daily
2.03Profit factor
15,283Net profit EUR
46.15%Win rate
208Trades
-2,649Max drawdown
73.47Avg trade

Best run of 18. Nasdaq 100, Daily, spread 3, from run pf:2026-10-10-NAS100-D.tsv:5.

Entry rules, long

  1. Buys one contract at market when not already long, after bar 25.

Exit rules

  1. The close is at or below the prior bar's line, a 3-period EMA of (close minus 2 times the 20-period EMA of true range).

Test conditions

PeriodUp to 2026-10-10
InstrumentNasdaq 100, Daily
Spread3 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best runDaily2.03 20846.1515,283 EUR-2,649
USD/JPY1 hourn/a 2,07739.96372,160 USD-189,460
EUR/USDDailyn/a 18844.1565,768 USD-41,115
Nikkei 225Dailyn/a 20842.7922,241 USD-13,414
Nikkei 2254 hoursn/a 40943.5222,033 USD-8,135
Silver4 hoursn/a 47838.7016,945 USD-10,998
Dow JonesDailyn/a 24643.5015,777 EUR-4,388
Nasdaq 1004 hoursn/a 52843.3710,699 EUR-3,814
DAX 40Dailyn/a 30141.209,844 EUR-3,999
US Crude OilDailyn/a 18544.328,258 EUR-6,892
DAX 404 hoursn/a 48843.447,338 EUR-4,383
DAX 401 hourn/a 1,87740.016,219 EUR-4,872
Nasdaq 10030 minn/a 3,55837.325,519 EUR-5,207
S&P 500Dailyn/a 27440.882,499 EUR-646
GoldDailyn/a 21540.932,049 EUR-1,239
Gold4 hoursn/a 49239.231,676 EUR-1,023
Gold1 hourn/a 1,88038.831,605 EUR-651
S&P 5004 hoursn/a 55140.651,352 EUR-1,231

Charts

Results by run

Top 10 of 18 runs. The full list is in the table above.

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Donchian Breakout With ATR Line Exit
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

myAtr = ExponentialAverage[20](TR(close))
atrline = ExponentialAverage[3](close - 2 * myAtr)
upper = highest[20](high)
lower = lowest[10](low)

14 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

Donchian ChannelEMATrue Range
Longer historyRe-run on up to 1,000,000 barsNasdaq 100 · Daily · older data 0.00 EUR

Nasdaq 100 had no history beyond the standard run, so both runs used 10,000 bars.

Nasdaq 100 · Daily

Bars available10,000
Net, standard 200,000-bar run15,282.70 EUR
Net, long run15,282.70 EUR
Net on the older data alone0.00 EUR
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Donchian Breakout With ATR Line Exit in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 18 market and timeframe combinations. The best run was Nasdaq 100, Daily, with a profit factor of 2.03 over 208 trades.

How large was the drawdown?

The best run had a maximum drawdown of 2,649 EUR at the tested position size, against a net result of 15,283 EUR.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

Volatility Spike Regression Long

Best run on the same market, Nasdaq 100.

1.22 PF · 1,850 trades

Ichimoku Cloud Breakout Long (long only)

Also a breakout strategy.

2.01 PF · 227 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

Copy trading on US indices is available to ProRealAlgos members as spots open.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs