It sells short when the close crosses over the lower Bollinger Band and buys when it crosses under the upper band (51 periods, 3.01 standard deviations). Each trade has a 14.2% profit target and a 99% stop loss, and an opposite signal reverses it.
Best run of 19. Gold, 4 hours, spread 0.6, from run pf:2026-10-12-GOLD-4h.tsv:7.
| Period | Up to 2026-10-12 |
| Instrument | Gold, 4 hours |
| 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 | 4 hours | 2.06 | 110 | 44.55 | 3,575 EUR | -683 |
| Gold | 2 min | 1.29 | 692 | 39.88 | 2,677 EUR | -554 |
| USD/JPY | Daily | n/a | 39 | 53.85 | 2,745,460 USD | -528,850 |
| USD/JPY | 15 min | n/a | 863 | 40.44 | 560,660 USD | -278,130 |
| USD/JPY | 10 min | n/a | 858 | 40.68 | 246,790 USD | -204,430 |
| USD/JPY | 5 min | n/a | 817 | 39.53 | 205,220 USD | -166,840 |
| EUR/USD | Daily | n/a | 40 | 55.00 | 116,408 USD | -45,590 |
| Silver | 1 hour | n/a | 581 | 38.04 | 40,975 USD | -18,616 |
| Silver | 2 min | n/a | 717 | 39.61 | 39,205 USD | -16,047 |
| GBP/USD | Daily | n/a | 43 | 53.49 | 22,806 USD | -10,040 |
| Silver | 1 min | n/a | 614 | 40.07 | 13,742 USD | -12,746 |
| US Crude Oil | 1 hour | n/a | 345 | 46.09 | 11,445 EUR | -10,513 |
| DAX 40 | 15 min | n/a | 939 | 39.94 | 9,600 EUR | -9,229 |
| US Crude Oil | 3 min | n/a | 750 | 41.33 | 8,251 EUR | -2,711 |
| Nasdaq 100 | 10 min | n/a | 962 | 41.06 | 8,118 EUR | -5,632 |
| DAX 40 | 10 min | n/a | 882 | 40.36 | 7,231 EUR | -5,072 |
| Brent Crude | 4 hours | n/a | 68 | 51.47 | 6,043 EUR | -4,862 |
| Gold | 3 min | n/a | 753 | 40.24 | 2,842 EUR | -719 |
| GBP/USD | 10 min | n/a | 845 | 41.66 | 2,546 USD | -2,186 |
Charts
Top 10 of 19 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Bollinger Band Crossover Reversal // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false base = Average[51](close) dev = 3.01 * STD[51](close) upper = base + dev lower = base - dev
17 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 19 market and timeframe combinations. The best run was Gold, 4 hours, with a profit factor of 2.06 over 110 trades.
The best run had a maximum drawdown of 683 EUR at the tested position size, against a net result of 3,575 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.