Join waitlist
Strategies / Mean reversion / Percent B Threshold Reversion

Percent B Threshold Reversion

The system measures where price sits inside Bollinger Bands as %B, buying when %B drops below -0.2 and selling short when it rises above 1.2. Longs close at %B of 0.2 or higher, and shorts close at 1.0 or lower.

Mean reversionLong & shortSwingSilver1 hour
5.66Profit factor
546,831Net profit USD
53.60%Win rate
2,377Trades
-29,170Max drawdown
230Avg trade

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

Entry rules, long

  1. After bar 25, %B (21-period average, 2 standard deviations) is below -0.2 while no position is open.

Entry rules, short

  1. After bar 25, %B (21-period average, 2 standard deviations) is above 1.2 while no position is open.

Exit rules

  1. A short closes when %B falls to 1.0 or lower.

Test conditions

PeriodUp to 2026-10-12
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
SilverBest run1 hour5.66 2,37753.60546,831 USD-29,170
Dow JonesDaily3.24 11957.9813,492 EUR-2,181
EUR/USDDailyn/a 10262.7532,695 USD-13,660
Nasdaq 100Dailyn/a 7855.136,087 EUR-939
DAX 40Dailyn/a 12658.735,210 EUR-2,154
FTSE 100Dailyn/a 10468.272,751 EUR-820
S&P 500Dailyn/a 10755.141,470 EUR-467

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Percent B Threshold Reversion
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE bbr = 0.5

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

20 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 Percent B Threshold Reversion 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 5.66 over 2,377 trades.

How large was the drawdown?

The best run had a maximum drawdown of 29,170 USD at the tested position size, against a net result of 546,830 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

EMA Deviation Reversion

Also a mean reversion strategy.

5.65 PF · 127 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