Join waitlist
Strategies / Breakout / Donchian Breakout With Quality Score

Donchian Breakout With Quality Score

The system buys on a break above the prior 50-bar high when the 200-period EMA is rising and a quality score is 0.8 or higher, and shorts the mirror setup. Positions close on a break through the opposite 50-bar channel or after 80 bars.

BreakoutLong & shortSwingS&P 500Daily
2.18Profit factor
3,403Net profit EUR
60.18%Win rate
113Trades
-743Max drawdown
30.12Avg trade

Best run of 20. S&P 500, Daily, spread 1, from run pf:2026-10-04-USA500-D.tsv:5.

Entry rules, long

  1. The 200-period EMA is higher than its value 30 bars earlier.
  2. The composite quality score is at least 0.8.
  3. The quality score combines EMA slope, position within the 600-bar range, EMA distance, and penalties for recent closes near the breakout level.

Entry rules, short

  1. The 200-period EMA is lower than its value 30 bars earlier.
  2. The composite quality score, using the same definition, is at least 0.8.

Exit rules

  1. The long closes 80 bars after the entry bar.
  2. The short closes when the close rises above the prior 50-bar highest high.
  3. The short closes 80 bars after the entry bar.

Test conditions

PeriodUp to 2026-10-04
InstrumentS&P 500, Daily
Spread1 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-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
S&P 500Best runDaily2.18 11360.183,403 EUR-743
Gold30 min1.22 1,39246.412,425 EUR-511
USD/JPYDailyn/a 8556.471,270,880 USD-553,000
USD/JPY4 hoursn/a 24450.41811,840 USD-236,360
USD/JPY1 hourn/a 1,04045.67383,100 USD-222,390
USD/JPY15 minn/a 1,48243.93214,630 USD-206,200
EUR/USDDailyn/a 7356.1645,001 USD-44,050
Silver30 minn/a 1,29844.2231,985 USD-11,484
Silver4 hoursn/a 18045.0025,997 USD-15,123
Nikkei 225Dailyn/a 7247.2220,768 USD-10,873
Nikkei 2254 hoursn/a 17846.6320,007 USD-10,248
Dow JonesDailyn/a 10552.3810,968 EUR-9,210
Dow Jones30 minn/a 59345.709,825 EUR-9,246
Nasdaq 100Dailyn/a 9160.448,036 EUR-4,476
Nasdaq 1004 hoursn/a 24351.447,837 EUR-5,897
GoldDailyn/a 8154.322,721 EUR-1,108
Gold4 hoursn/a 21747.472,706 EUR-736
Gold1 hourn/a 85344.782,590 EUR-803
Gold15 minn/a 1,42242.621,743 EUR-833
S&P 5004 hoursn/a 24052.921,309 EUR-993

Charts

Results by run

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

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Donchian Breakout With Quality Score
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE entrybar = 0

dchigh = highest[50](high)[1]
dclow = lowest[50](low)[1]
ema = ExponentialAverage[200](close)
myAtr = AverageTrueRange[14](close)
macrohigh = highest[600](high)[1]
macrolow = lowest[600](low)[1]
macrorng = macrohigh - macrolow

64 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

EMAATRDonchian Channel
Longer historyRe-run on up to 1,000,000 barsS&P 500 · Daily · older data 33.57 EUR

S&P 500 had no history beyond the standard run, so both runs used 14,000 bars.

S&P 500 · Daily

Bars available14,000
Net, standard 200,000-bar run3,403.29 EUR
Net, long run3,436.86 EUR
Net on the older data alone33.57 EUR
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Donchian Breakout With Quality Score 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 20 market and timeframe combinations. The best run was S&P 500, Daily, with a profit factor of 2.18 over 113 trades.

How large was the drawdown?

The best run had a maximum drawdown of 743 EUR at the tested position size, against a net result of 3,403 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

Bollinger 120 Breakout With SMA Exit

Also a breakout strategy.

2.21 PF · 101 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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