Join today
Strategies / Breakout / Bollinger Breakout

Bollinger Breakout: Trading Closes Outside the Bands

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.

BreakoutLong & shortIntradayNasdaq 10030 min
n/aProfit factor
-17,708Net profit EUR
30.48%Win rate
8,117Trades
-20,713Max drawdown
-2.18Avg trade

Best run of 16. Nasdaq 100, 30 min, spread 3, from run sweeps:2026-09-07-NAS100-30m-opt.tsv:7.

Entry rules, long

  1. Members only
  2. No open position

Entry rules, short

  1. Members only
  2. No open position

Exit rules

  1. Stop loss 1% from entry
  2. Members only
  3. Cover a short when the close rises above the 20-bar midline

Test conditions

PeriodUp to 2026-09-07
InstrumentNasdaq 100, 30 minutes
Spread3 points
Contracts1
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-09-07

Parameters

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

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run30 minn/a 8,11730.48-17,708 EUR-20,713
DAX 401 hourn/a 4,52434.882,158 EUR-5,304
Gold1 hourn/a 4,66534.73450 EUR-1,036
Gold30 minn/a 7,74232.74120 EUR-3,196
Gold15 minn/a 7,60030.36-3,071 EUR-4,227
Gold5 minn/a 7,40229.11-3,529 EUR-3,616
DAX 4030 minn/a 7,72432.29-6,450 EUR-11,223
S&P 5001 hourn/a 5,16732.96-6,817 EUR-7,251
S&P 50030 minn/a 8,04031.01-7,424 EUR-9,385
S&P 5005 minn/a 7,53628.26-8,285 EUR-8,313
S&P 50015 minn/a 7,67530.35-8,645 EUR-8,728
Nasdaq 1001 hourn/a 5,25232.84-11,791 EUR-13,154
Nasdaq 1005 minn/a 7,45831.54-19,822 EUR-20,050
Nasdaq 10015 minn/a 7,65031.57-20,270 EUR-20,697
DAX 405 minn/a 7,39129.09-20,632 EUR-20,855
DAX 4015 minn/a 7,60331.12-28,925 EUR-28,944

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-50K-25K1K3KDAX 40 · 1 hourGold · 1 hourGold · 30 minGold · 15 minGold · 5 minDAX 40 · 30 minS&P 500 · 1 hourS&P 500 · 30 minS&P 500 · 5 minS&P 500 · 15 minNasdaq 100 · 1 hourNasdaq 100 · 30 minNasdaq 100 · 5 minNasdaq 100 · 15 minDAX 40 · 5 minDAX 40 · 15 min

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// 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.

Read this first

Known weaknesses

  • Most runs lost money. Only DAX 40 on 1 hour (2,158.40 EUR), Gold on 1 hour (450.30 EUR) and Gold on 30 minutes (119.80 EUR) finished positive across all the runs listed.
  • The headline run on Nasdaq 100 30 minutes ended at -17,708.40 EUR over 8117 trades, with a max drawdown of 20,713.30 EUR.
  • Win rates sit around 30% (30.48% in the headline run), and the average trade was -2.18 EUR, so spread costs of 3 points weigh heavily.
  • Profit factor was not recorded because only sweep data exists for this strategy.

Indicators used

Bollinger BandsSMA

How to load it

  1. Copy the code with the copy button above the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Questions

About this strategy

Can it run live in ProOrder?

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.

How did it do across markets?

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.

What position size and risk were used?

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.

Which timeframe held up best?

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

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Negated Hammer

Best run on the same market, Nasdaq 100.

3.20 PF · 372 trades

Breakout Regime Filter

Also a breakout strategy.

6.28 PF · 70 trades

Curious how breakout ideas get filtered before going live? Get on the ProRealAlgos waitlist.

Copy trading on US indices is available to ProRealAlgos members as spots open.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs