The idea buys when the close moves above the upper Bollinger Band while the 200-period SMA is not falling, and sells short below the lower band while it is falling. Trades exit on a slope turn and carry a 0.5 percent stop.
Best run of 9. Gold, 30 min, spread 0.6, from run sweeps:2026-10-04-GOLD-30m-opt.tsv:66.
| Period | Up to 2026-10-04 |
| 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 30 min | n/a | 3,878 | 29.68 | 1,330 EUR | -1,188 |
| USD/JPY | Daily | n/a | 389 | 13.88 | 682,830 USD | -466,710 |
| USD/JPY | 30 min | n/a | 3,657 | 33.66 | 437,130 USD | -191,120 |
| USD/JPY | 1 hour | n/a | 2,691 | 34.34 | 431,290 USD | -263,130 |
| EUR/USD | 4 hours | n/a | 913 | 27.27 | 33,446 USD | -32,054 |
| Nikkei 225 | Daily | n/a | 417 | 9.35 | 30,987 USD | -12,045 |
| Silver | 4 hours | n/a | 1,076 | 11.43 | 28,448 USD | -10,512 |
| Gold | Daily | n/a | 623 | 7.54 | 1,878 EUR | -809 |
| Gold | 4 hours | n/a | 797 | 21.46 | 1,715 EUR | -1,031 |
Charts
The code
// ============================================================== // Bollinger Breakout With Trend Slope // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================== DEFPARAM CumulateOrders = false basis = Average[20](close) dev = 2.0 * STD[20](close) upper = basis + dev lower = basis - dev sma = Average[200](close)
28 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 9 market and timeframe combinations. The best run by trade count was Gold, 30 minutes, with 3,878 trades.
The best run had a maximum drawdown of 1,188 EUR at the tested position size, against a net result of 1,330 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.