The system buys on a break above the prior 20-bar high while the 200-period SMA is flat or rising, and sells short on a break below the prior 20-bar low while it is falling. Each trade has a 0.5% stop and a 1.0% target.
Best run of 11. DAX 40, 1 hour, spread 3, from run sweeps:2026-10-03-DAX40-1h-opt.tsv:32.
| Period | Up to 2026-10-03 |
| Instrument | DAX 40, 1 hour |
| Spread | 3 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-03 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| DAX 40Best run | 1 hour | n/a | 3,714 | 33.49 | 4,539 EUR | -4,397 |
| USD/JPY | Daily | n/a | 854 | 36.53 | 847,040 USD | -214,010 |
| USD/JPY | 1 hour | n/a | 2,619 | 34.02 | 732,710 USD | -317,150 |
| USD/JPY | 10 min | n/a | 1,848 | 31.06 | 471,580 USD | -190,810 |
| USD/JPY | 15 min | n/a | 1,961 | 31.36 | 334,250 USD | -226,650 |
| USD/JPY | 30 min | n/a | 2,593 | 33.05 | 326,820 USD | -268,560 |
| EUR/USD | 1 hour | n/a | 3,231 | 33.55 | 33,180 USD | -29,913 |
| EUR/USD | Daily | n/a | 840 | 34.64 | 19,861 USD | -15,498 |
| Nikkei 225 | 3 min | n/a | 2,384 | 32.47 | 18,990 USD | -8,244 |
| GBP/USD | Daily | n/a | 912 | 34.43 | 3,615 USD | -3,323 |
| Gold | 4 hours | n/a | 1,519 | 33.25 | 628 EUR | -543 |
Charts
Top 10 of 11 runs. The full list is in the table above.
The code
// ============================================================== // Donchian Breakout With SMA Slope // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 1 hour // ============================================================== DEFPARAM CumulateOrders = false sma = Average[200](close)
20 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 11 market and timeframe combinations. The best run by trade count was DAX 40, 1 hour, with 3,714 trades.
The best run had a maximum drawdown of 4,397 EUR at the tested position size, against a net result of 4,539 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.