Join today
Strategies / Breakout / Donchian Breakout Activator

Donchian Breakout Activator: 20 bar channel breakouts

The strategy goes long when the close breaks above the previous 20 bar high and short when it breaks below the 20 bar low. A long is closed when price falls back below the 20 bar low, and the stop sits one ATR(20) beyond the opposite channel line. It is a classic always in the trend breakout.

BreakoutLong & shortSwingUSD/JPY1 hour
n/aProfit factor
391,250Net profit JPY
36.88%Win rate
3,075Trades
-389,050Max drawdown
127Avg trade

Best run of 7. USD/JPY, 1 hour, spread 1, from run sweeps:2026-09-24-USDJPY-1h-opt.tsv:7.

Entry rules, long

  1. Members only

Entry rules, short

  1. Members only

Exit rules

  1. Stop loss at the opposite channel line minus (long) or plus (short) 1 x ATR(20), fixed at entry
  2. Members only
  3. Cover a short when the close rises above the 20-bar high

Test conditions

PeriodUp to 2026-09-24
InstrumentUSD/JPY, 1 hour
Spread1 points
Contracts1
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-09-24

Parameters

positionSize
Contracts per trade
1
channelPeriod
Donchian channel and ATR length
20
atrMultiplier
Stop sits this many ATRs beyond the opposite channel line
1
channelOffset
Channel taken this many bars back so the breakout bar is excluded
1

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run1 hourn/a 3,07536.88391,250 JPY-389,050
USD/JPYDailyn/a 30040.332,651,670 JPY-912,270
EUR/USDDailyn/a 29940.13106,944 USD-72,279
US Crude OilDailyn/a 26940.1522,662 EUR-5,980
Brent CrudeDailyn/a 11638.7914,371 EUR-11,386
GBP/USDDailyn/a 32437.9611,107 USD-9,979
GoldDailyn/a 32634.052,469 EUR-952

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-1.0M-500K2.5M5.0MUSD/JPY · DailyUSD/JPY · 1 hourEUR/USD · DailyUS Crude Oil · DailyBrent Crude · DailyGBP/USD · DailyGold · Daily

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Donchian Breakout Activator
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: 1 hour
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
positionSize = 1       // contracts per trade
channelPeriod = 20     // Donchian channel and ATR length
atrMultiplier = 1      // stop sits this many ATRs beyond the opposite channel line
channelOffset = 1      // channel taken this many bars back, so the breakout bar is excluded

ONCE stopDistance = 0

// --- Indicators ---
channelHigh = Highest[channelPeriod](high)[channelOffset]
channelLow = Lowest[channelPeriod](low)[channelOffset]
atrValue = AverageTrueRange[channelPeriod](close)
upperStopLevel = channelHigh + atrMultiplier * atrValue
lowerStopLevel = channelLow - atrMultiplier * atrValue

29 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • Only sweep data exists, so profit factor was not recorded.
  • On USD/JPY 1 hour, max drawdown was JPY 389,050, nearly equal to the JPY 391,250 net profit.
  • Win rates ranged from 34.05% to 40.33% across tests, so long losing streaks are normal for this breakout style.
  • The exits wait for the opposite channel line, so a lot of open profit can be given back before a trade closes.

Indicators used

Donchian ChannelATR

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Can the Donchian Breakout Activator run live in ProOrder?

Yes, it uses plain ProOrder entries and a stop set at entry. The rewrite is not compile checked yet, so backtest it first.

Which markets were tested?

USD/JPY, EUR/USD, US Crude Oil, Brent Crude, GBP/USD and Gold. All listed runs were profitable, with Gold Daily the smallest at EUR 2,468.5.

What capital does 1 contract need?

At 1 contract the best run hit a max drawdown of JPY 389,050 on USD/JPY 1 hour, while US Crude Oil Daily stayed at EUR 5,980.3. Size capital to the instrument you trade.

Why 1 hour and daily bars?

Channel breakouts need room to trend. Intraday noise on shorter bars tends to trigger more false breaks, so the tests focus on 1 hour and Daily.

Related

Strategies like this one

ATR Band

Uses the same indicator.

10.31 PF · 53 trades

Supertrend Counter Trend

Best run on the same market, USD/JPY.

3.47 PF · 1,444 trades

Breakout Regime Filter

Also a breakout strategy.

6.28 PF · 70 trades

Breakout systems are a regular topic in the ProRealAlgos community. Join the waitlist to take part.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

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