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.
Best run of 7. USD/JPY, 1 hour, spread 1, from run sweeps:2026-09-24-USDJPY-1h-opt.tsv:7.
| Period | Up to 2026-09-24 |
| Instrument | USD/JPY, 1 hour |
| Spread | 1 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-24 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 1 hour | n/a | 3,075 | 36.88 | 391,250 JPY | -389,050 |
| USD/JPY | Daily | n/a | 300 | 40.33 | 2,651,670 JPY | -912,270 |
| EUR/USD | Daily | n/a | 299 | 40.13 | 106,944 USD | -72,279 |
| US Crude Oil | Daily | n/a | 269 | 40.15 | 22,662 EUR | -5,980 |
| Brent Crude | Daily | n/a | 116 | 38.79 | 14,371 EUR | -11,386 |
| GBP/USD | Daily | n/a | 324 | 37.96 | 11,107 USD | -9,979 |
| Gold | Daily | n/a | 326 | 34.05 | 2,469 EUR | -952 |
Charts
The code
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
Questions
Yes, it uses plain ProOrder entries and a stop set at entry. The rewrite is not compile checked yet, so backtest it first.
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.
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.
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
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.