Join waitlist
Strategies / Mean reversion / Bollinger Band Reversion To Basis

Bollinger Band Reversion To Basis

The strategy buys when close falls below the lower 20-bar Bollinger Band and sells short when it rises above the upper band. Longs close when price returns to the 20-bar average or higher, and shorts close when it returns to or below it.

Mean reversionLong & shortSwingSilver1 hour
2.33Profit factor
480,118Net profit USD
60.75%Win rate
4,691Trades
-92,409Max drawdown
102Avg trade

Best run of 7. Silver, 1 hour, spread 2, from run pf:2026-10-10-SILVER-1h.tsv:3.

Entry rules, long

  1. When no long is open, the close is below the lower band (20-bar SMA minus 2 standard deviations).

Entry rules, short

  1. When no short is open, the close is above the upper band (20-bar SMA plus 2 standard deviations).

Exit rules

  1. A short is bought to cover when the close is at or below the 20-bar SMA, unless a long signal is also present.

Test conditions

PeriodUp to 2026-10-10
InstrumentSilver, 1 hour
Spread2 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-10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
SilverBest run1 hour2.33 4,69160.75480,118 USD-92,409
Dow JonesDailyn/a 54464.8913,318 EUR-9,762
Nasdaq 1004 hoursn/a 1,20962.709,203 EUR-4,134
FTSE 100Dailyn/a 42965.976,624 EUR-2,521
S&P 500Dailyn/a 56665.193,233 EUR-1,082
FTSE 1004 hoursn/a 1,13665.933,084 EUR-2,184
S&P 5004 hoursn/a 1,22963.791,620 EUR-1,304

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Bollinger Band Reversion To Basis
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

basis = Average[20](close)
dev = 2.0 * STD[20](close)
upper = basis + dev
lower = basis - dev

17 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 Deviation
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Bollinger Band Reversion To Basis 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 7 market and timeframe combinations. The best run was Silver, 1 hour, with a profit factor of 2.33 over 4,691 trades.

How large was the drawdown?

The best run had a maximum drawdown of 92,408 USD at the tested position size, against a net result of 480,118 USD.

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

SMA Crossover With RSI Exit

Best run on the same market, Silver.

2.13 PF · 8,999 trades

Three Lower Highs and Lows

Also a mean reversion strategy.

2.36 PF · 187 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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