Join waitlist
Strategies / Breakout / Bollinger Breakout With Range Filter

Bollinger Breakout With Range Filter

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.

BreakoutLong & shortSwingGold1 hour
n/aProfit factor
1,019Net profit EUR
34.95%Win rate
4,532Trades
-854Max drawdown
0.22Avg trade

Best run of 5. Gold, 1 hour, spread 0.6, from run sweeps:2026-10-12-GOLD-1h-opt.tsv:50.

Entry rules, long

  1. The low is above the 50-bar lowest low plus 1% of the 50-bar range.

Entry rules, short

  1. The high is below the 50-bar highest high.

Exit rules

  1. A short is bought to cover when the close crosses over the 20-bar SMA.

Test conditions

PeriodUp to 2026-10-12
InstrumentGold, 1 hour
Spread0.6 points
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-10-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run1 hourn/a 4,53234.951,019 EUR-854
Silver4 hoursn/a 1,11435.6439,743 USD-12,903
Nikkei 2254 hoursn/a 88038.3011,412 USD-9,620
Brent CrudeDailyn/a 19040.009,605 EUR-9,010
Gold4 hoursn/a 1,13336.451,394 EUR-919

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

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

How to load it

  1. Copy the code with the copy button on 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.

Indicators used

Bollinger BandsSMAStandard DeviationDonchian Channel
Read this firstKnown weaknesses3 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 854 EUR is large next to the net profit of 1,019 EUR.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run Bollinger Breakout With Range Filter in ProOrder?

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.

Which markets was it tested on?

It was tested on 5 market and timeframe combinations. The best run by trade count was Gold, 1 hour, with 4,532 trades.

How large was the drawdown?

The best run had a maximum drawdown of 854 EUR at the tested position size, against a net result of 1,019 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

Big Candle Breakout

Also a breakout strategy.

n/a PF · 4,636 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

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