This system goes long when a bar closes above the upper Bollinger Band (20, 2) and short when it closes below the lower band. Positions exit at the 20-bar midline or at a 1% stop. It was tested on 5 minute to 1 hour charts.
Best run of 16. Nasdaq 100, 30 min, spread 3, from run sweeps:2026-09-07-NAS100-30m-opt.tsv:7.
| Period | Up to 2026-09-07 |
| Instrument | Nasdaq 100, 30 minutes |
| Spread | 3 points |
| Contracts | 1 |
| 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-09-07 |
| positionSize Contracts per trade | 1 |
| bandPeriod Bollinger Band length | 20 |
| bandWidth Standard deviations from the midline | 2 |
| stopLossPct Protective stop, percent of entry price | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | 30 min | n/a | 8,117 | 30.48 | -17,708 EUR | -20,713 |
| DAX 40 | 1 hour | n/a | 4,524 | 34.88 | 2,158 EUR | -5,304 |
| Gold | 1 hour | n/a | 4,665 | 34.73 | 450 EUR | -1,036 |
| Gold | 30 min | n/a | 7,742 | 32.74 | 120 EUR | -3,196 |
| Gold | 15 min | n/a | 7,600 | 30.36 | -3,071 EUR | -4,227 |
| Gold | 5 min | n/a | 7,402 | 29.11 | -3,529 EUR | -3,616 |
| DAX 40 | 30 min | n/a | 7,724 | 32.29 | -6,450 EUR | -11,223 |
| S&P 500 | 1 hour | n/a | 5,167 | 32.96 | -6,817 EUR | -7,251 |
| S&P 500 | 30 min | n/a | 8,040 | 31.01 | -7,424 EUR | -9,385 |
| S&P 500 | 5 min | n/a | 7,536 | 28.26 | -8,285 EUR | -8,313 |
| S&P 500 | 15 min | n/a | 7,675 | 30.35 | -8,645 EUR | -8,728 |
| Nasdaq 100 | 1 hour | n/a | 5,252 | 32.84 | -11,791 EUR | -13,154 |
| Nasdaq 100 | 5 min | n/a | 7,458 | 31.54 | -19,822 EUR | -20,050 |
| Nasdaq 100 | 15 min | n/a | 7,650 | 31.57 | -20,270 EUR | -20,697 |
| DAX 40 | 5 min | n/a | 7,391 | 29.09 | -20,632 EUR | -20,855 |
| DAX 40 | 15 min | n/a | 7,603 | 31.12 | -28,925 EUR | -28,944 |
Charts
Top 10 of 16 runs. The full list is in the table above.
The code
// ============================================================ // Bollinger Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade bandPeriod = 20 // Bollinger Band length bandWidth = 2 // standard deviations from the midline stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- // Bands built by hand so the 2 sigma width is explicit. midBand = Average[bandPeriod](close) stdDevValue = STD[bandPeriod](close) upperBand = midBand + bandWidth * stdDevValue lowerBand = midBand - bandWidth * stdDevValue
26 more lines: the entry and exit rules.
Setup
Questions
Yes, the code runs as an automated ProOrder system with a 1% stop loss. Given the test results, treat it as a starting point for research rather than something to trade as is.
It was tested on DAX 40, Gold, S&P 500 and Nasdaq 100. Three runs made a small profit, and the rest lost, with DAX 40 on 15 minutes losing 28,924.50 EUR.
One contract per trade with a 3 point spread. The headline Nasdaq 100 run had a max drawdown of 20,713.30 EUR at that size.
The 1 hour charts did least badly, with DAX 40 and Gold both positive there. The 5 and 15 minute runs lost on every instrument.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.