The system tracks whether price has touched the 20-bar lower or upper band since the last open position. It buys after a prior lower-band touch when price reaches the upper band and closes above the 200-period EMA, and sells short in the mirror case.
Best run of 17. S&P 500, Daily, spread 1, from run pf:2026-10-12-USA500-D.tsv:22.
| Period | Up to 2026-10-12 |
| Instrument | S&P 500, 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 |
|---|---|---|---|---|---|---|
| S&P 500Best run | Daily | 2.15 | 129 | 48.06 | 5,322 EUR | -1,253 |
| USD/JPY | Daily | 1.27 | 2,533 | 44.97 | 250,480 USD | -19,280 |
| Silver | 3 min | n/a | 755 | 42.78 | 43,206 USD | -12,404 |
| Nikkei 225 | Daily | n/a | 83 | 55.42 | 38,841 USD | -12,192 |
| Nasdaq 100 | 4 hours | n/a | 249 | 42.97 | 10,152 EUR | -6,342 |
| FTSE 100 | Daily | n/a | 89 | 52.81 | 8,398 EUR | -2,958 |
| US Crude Oil | 5 min | n/a | 784 | 40.05 | 6,492 EUR | -4,211 |
| Nasdaq 100 | 3 min | n/a | 405 | 42.72 | 6,302 EUR | -4,759 |
| DAX 40 | 1 min | n/a | 153 | 48.37 | 5,223 EUR | -2,319 |
| Nasdaq 100 | 5 min | n/a | 531 | 40.30 | 4,486 EUR | -3,328 |
| Nasdaq 100 | 2 min | n/a | 283 | 43.46 | 4,165 EUR | -3,998 |
| Gold | 3 min | n/a | 519 | 43.35 | 2,946 EUR | -784 |
| Gold | 1 hour | n/a | 733 | 42.84 | 2,290 EUR | -904 |
| Gold | 5 min | n/a | 551 | 43.01 | 2,095 EUR | -1,063 |
| Gold | 30 min | n/a | 987 | 41.03 | 1,902 EUR | -1,064 |
| S&P 500 | 3 min | n/a | 253 | 41.90 | 1,305 EUR | -1,276 |
| Gold | 4 hours | n/a | 189 | 43.92 | 1,049 EUR | -821 |
Charts
Top 10 of 17 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Alternating Donchian Breakout With EMA Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE prevhigh = 0 ONCE prevlow = 0 upper = highest[20](high) lower = lowest[20](low) ema = ExponentialAverage[200](close)
31 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 17 market and timeframe combinations. The best run was S&P 500, Daily, with a profit factor of 2.15 over 129 trades.
The best run had a maximum drawdown of 1,253 EUR at the tested position size, against a net result of 5,322 EUR.
It trades both long and short.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.