The strategy buys when the close moves back above the lower 20-period Bollinger Band and sells short when it moves back below the upper band. Positions close at the middle band, and an opposite signal reverses the trade.
Best run of 7. EUR/USD, 4 hours, spread 1, from run sweeps:2026-10-04-EURUSD-4h-opt.tsv:17.
| Period | Up to 2026-10-04 |
| Instrument | EUR/USD, 4 hours |
| Spread | 1 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 |
|---|---|---|---|---|---|---|
| EUR/USDBest run | 4 hours | n/a | 1,687 | 64.91 | 50,695 USD | -27,600 |
| USD/JPY | 4 hours | n/a | 1,317 | 65.07 | 296,940 USD | -291,390 |
| Dow Jones | Daily | n/a | 544 | 67.28 | 11,777 EUR | -8,615 |
| Nasdaq 100 | 4 hours | n/a | 1,203 | 64.67 | 10,988 EUR | -4,346 |
| FTSE 100 | Daily | n/a | 428 | 67.06 | 7,037 EUR | -2,009 |
| S&P 500 | Daily | n/a | 565 | 68.50 | 2,639 EUR | -1,087 |
| S&P 500 | 4 hours | n/a | 1,226 | 65.33 | 2,574 EUR | -965 |
Charts
The code
// ============================================================== // Bollinger Band Reversal Long Short // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false mid = Average[20](close) sd = STD[20](close) upper = mid + 2 * sd lower = mid - 2 * sd
13 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 7 market and timeframe combinations. The best run by trade count was EUR/USD, 4 hours, with 1,687 trades.
The best run had a maximum drawdown of 27,600 USD at the tested position size, against a net result of 50,695 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.