The strategy buys when the close breaks above the highest high of the prior 20 bars and is at or above the 200-period EMA. Each trade has a stop at 2 times the 20-period ATR and a target at 2 times that distance.
Best run of 18. Gold, Daily, spread 0.6, from run pf:2026-10-12-GOLD-D.tsv:9.
| Period | Up to 2026-10-12 |
| Instrument | Gold, Daily |
| Spread | 0.6 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 |
|---|---|---|---|---|---|---|
| GoldBest run | Daily | 1.62 | 261 | 43.68 | 2,546 EUR | -501 |
| DAX 40 | Daily | 1.49 | 362 | 37.85 | 12,977 EUR | -2,741 |
| USD/JPY | Daily | 1.42 | 520 | 39.04 | 26,920 USD | -4,270 |
| Gold | 4 hours | 1.41 | 586 | 39.25 | 2,730 EUR | -531 |
| Dow Jones | 1 hour | 1.24 | 723 | 36.93 | 17,897 EUR | -3,967 |
| S&P 500 | 4 hours | 1.23 | 567 | 34.04 | 2,095 EUR | -479 |
| Nikkei 225 | 30 min | n/a | 3,323 | 32.47 | 16,648 USD | -9,276 |
| Nikkei 225 | 4 hours | n/a | 459 | 36.82 | 15,500 USD | -7,219 |
| Silver | 4 hours | n/a | 506 | 37.75 | 13,969 USD | -10,267 |
| Nikkei 225 | 1 hour | n/a | 1,677 | 33.57 | 13,632 USD | -10,121 |
| Dow Jones | Daily | n/a | 277 | 40.79 | 11,453 EUR | -8,336 |
| DAX 40 | 4 hours | n/a | 539 | 36.55 | 7,986 EUR | -2,452 |
| Nasdaq 100 | 4 hours | n/a | 629 | 35.93 | 7,552 EUR | -3,762 |
| Nasdaq 100 | 30 min | n/a | 3,638 | 32.44 | 7,359 EUR | -3,093 |
| Nasdaq 100 | Daily | n/a | 285 | 36.84 | 7,319 EUR | -3,398 |
| US Crude Oil | Daily | n/a | 215 | 39.07 | 7,029 EUR | -4,518 |
| Dow Jones | 4 hours | n/a | 175 | 36.00 | 6,244 EUR | -4,447 |
| S&P 500 | Daily | n/a | 331 | 36.25 | 1,821 EUR | -768 |
Charts
Top 10 of 18 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Channel Breakout With Trend Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false up = highest[20](high)[1] upprev = highest[20](high)[2] ema = ExponentialAverage[200](close) myAtr = Average[20](TR(close)) dist = 2.0 * myAtr
9 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 18 market and timeframe combinations. The best run was Gold, Daily, with a profit factor of 1.62 over 261 trades.
The best run had a maximum drawdown of 501 EUR at the tested position size, against a net result of 2,546 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.