The system buys when price closes above the upper Bollinger Band while ATR is above its longer-term average. It closes the long when price falls below the 40-period average, with a 2 percent stop loss.
Best run of 26. Gold, 30 min, spread 0.6, from run pf:2026-10-12-GOLD-30m.tsv:2.
| Period | Up to 2026-10-12 |
| Instrument | Gold, 30 minutes |
| 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 | 30 min | 1.24 | 1,670 | 39.76 | 1,796 EUR | -455 |
| USD/JPY | 30 min | n/a | 1,413 | 40.34 | 374,430 USD | -112,970 |
| USD/JPY | 15 min | n/a | 1,416 | 38.84 | 275,400 USD | -79,220 |
| USD/JPY | 1 hour | n/a | 965 | 40.62 | 252,380 USD | -174,270 |
| EUR/USD | Daily | n/a | 80 | 43.75 | 31,229 USD | -29,134 |
| Nikkei 225 | Daily | n/a | 57 | 31.58 | 25,441 USD | -7,096 |
| Nikkei 225 | 4 hours | n/a | 141 | 41.13 | 24,738 USD | -5,924 |
| Silver | 4 hours | n/a | 235 | 33.19 | 15,013 USD | -14,716 |
| Nikkei 225 | 1 hour | n/a | 640 | 38.28 | 12,579 USD | -5,840 |
| Nikkei 225 | 3 min | n/a | 1,191 | 35.77 | 9,362 USD | -6,186 |
| Nikkei 225 | 5 min | n/a | 1,319 | 36.92 | 9,279 USD | -8,203 |
| Dow Jones | 30 min | n/a | 773 | 43.34 | 8,579 EUR | -6,888 |
| Nasdaq 100 | 30 min | n/a | 2,000 | 41.35 | 6,290 EUR | -3,027 |
| Nasdaq 100 | 1 hour | n/a | 1,005 | 37.51 | 6,211 EUR | -2,411 |
| Brent Crude | Daily | n/a | 40 | 17.50 | 5,662 EUR | -4,479 |
| DAX 40 | 1 hour | n/a | 859 | 39.23 | 4,091 EUR | -2,875 |
| Nasdaq 100 | 4 hours | n/a | 216 | 39.81 | 4,064 EUR | -2,317 |
| DAX 40 | Daily | n/a | 91 | 37.36 | 3,787 EUR | -1,733 |
| Dow Jones | 3 min | n/a | 1,268 | 35.09 | 3,751 EUR | -3,324 |
| Nasdaq 100 | 5 min | n/a | 1,290 | 35.43 | 3,694 EUR | -2,513 |
| Gold | 4 hours | n/a | 232 | 42.24 | 1,989 EUR | -621 |
| Gold | 1 hour | n/a | 934 | 40.90 | 1,388 EUR | -844 |
| Gold | 10 min | n/a | 1,427 | 34.41 | 1,075 EUR | -480 |
| Gold | 5 min | n/a | 1,348 | 35.98 | 1,026 EUR | -293 |
| S&P 500 | Daily | n/a | 105 | 32.38 | 898 EUR | -419 |
| S&P 500 | 4 hours | n/a | 205 | 40.98 | 826 EUR | -812 |
Charts
Top 10 of 26 runs. The full list is in the table above.
The code
// ============================================================== // Upper Band Breakout with ATR Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long only // Timeframe tested: 30 minutes // ============================================================== DEFPARAM CumulateOrders = false basis = Average[40](close) dev = STD[40](close) upper = basis + dev * 2 myAtr = AverageTrueRange[14](close) atrsm = ExponentialAverage[100](myAtr)
14 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 26 market and timeframe combinations. The best run was Gold, 30 minutes, with a profit factor of 1.24 over 1,670 trades.
The best run had a maximum drawdown of 455 EUR at the tested position size, against a net result of 1,796 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.