The system buys when the close exceeds the prior 10-bar high and sells short when it falls below the prior 10-bar low. Positions close when price crosses back through the midpoint of the 10-bar channel.
Best run of 4. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:2.
| Period | Up to 2026-10-12 |
| Instrument | USD/JPY, Daily |
| Spread | 1 points |
| 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-10-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.33 | 842 | 37.77 | 2,367,080 USD | -543,910 |
| Brent Crude | Daily | n/a | 342 | 41.52 | 12,582 EUR | -10,056 |
| GBP/USD | Daily | n/a | 916 | 40.28 | 11,432 USD | -8,804 |
| Gold | 4 hours | n/a | 1,937 | 38.51 | 1,165 EUR | -1,008 |
Charts
The code
// ============================================================== // Donchian Channel Midline Exit // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false hh = highest[10](high) ll = lowest[10](low) base = (hh + ll) / 2
21 more lines: the entry and exit rules.
Setup
Questions
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.
It was tested on 4 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.33 over 842 trades.
The best run had a maximum drawdown of 543,910 USD at the tested position size, against a net result of 2,367,080 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.