The strategy buys when close crosses above the upper Bollinger Band and low stays above the 50-bar lowest low plus 1% of the range. It sells short on the mirror setup, and each trade closes when close crosses the 20-bar SMA.
Best run of 5. Gold, 1 hour, spread 0.6, from run sweeps:2026-10-12-GOLD-1h-opt.tsv:50.
| Period | Up to 2026-10-12 |
| Instrument | Gold, 1 hour |
| 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 | 1 hour | n/a | 4,532 | 34.95 | 1,019 EUR | -854 |
| Silver | 4 hours | n/a | 1,114 | 35.64 | 39,743 USD | -12,903 |
| Nikkei 225 | 4 hours | n/a | 880 | 38.30 | 11,412 USD | -9,620 |
| Brent Crude | Daily | n/a | 190 | 40.00 | 9,605 EUR | -9,010 |
| Gold | 4 hours | n/a | 1,133 | 36.45 | 1,394 EUR | -919 |
Charts
The code
// ============================================================== // Bollinger Breakout With Range Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 1 hour // ============================================================== DEFPARAM CumulateOrders = false ONCE longpos = 0 ONCE shortpos = 0 basis = Average[20](close) dev = 2.0 * STD[20](close) upper = basis + dev lower = basis - dev hh = highest[50](high) ll = lowest[50](low) rng = hh - ll fibhigh = hh - rng * 0 fiblow = ll + rng * 0.01
38 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 5 market and timeframe combinations. The best run by trade count was Gold, 1 hour, with 4,532 trades.
The best run had a maximum drawdown of 854 EUR at the tested position size, against a net result of 1,019 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.