Join waitlist
Strategies / Mean reversion / Percent B Zero Cross Long

Percent B Zero Cross Long

The system buys when price moves back inside the lower Bollinger Band, measured as %B crossing above 0. It sells when %B reaches 1.0 or higher, with no stop loss.

Mean reversionLong onlySwingS&P 500Daily
3.20Profit factor
4,790Net profit EUR
80.23%Win rate
172Trades
-1,190Max drawdown
27.85Avg trade

Best run of 29. S&P 500, Daily, spread 1, from run pf:2026-10-05-USA500-D.tsv:20.

Entry rules, long

  1. After bar 25, %B crosses above 0, meaning the close moves back inside the lower band (20 periods, 2 standard deviations).

Exit rules

  1. No stop loss is set.

Test conditions

PeriodUp to 2026-10-05
InstrumentS&P 500, Daily
Spread1 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-05

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
S&P 500Best runDaily3.20 17280.234,790 EUR-1,190
Dow JonesDaily3.09 16478.6638,403 EUR-8,615
Nikkei 2251 hour1.34 1,12766.2842,555 USD-8,378
S&P 5001 hour1.27 1,62668.273,970 EUR-949
USD/JPY4 hoursn/a 41565.54380,970 USD-282,580
EUR/USD30 minn/a 2,54564.6041,290 USD-23,538
SilverDailyn/a 15269.0831,133 USD-9,678
Nikkei 2254 hoursn/a 27467.8822,510 USD-10,662
Dow Jones4 hoursn/a 12576.8019,500 EUR-11,189
Dow Jones1 hourn/a 53470.2217,738 EUR-7,394
DAX 40Dailyn/a 17365.3217,627 EUR-5,511
Nikkei 22530 minn/a 2,25864.0417,295 USD-16,235
Nasdaq 1004 hoursn/a 37873.5416,789 EUR-4,569
Nikkei 22515 minn/a 2,38464.8516,016 USD-14,329
Nasdaq 1001 hourn/a 1,62867.4414,985 EUR-4,988
Dow Jones30 minn/a 1,01867.7812,522 EUR-8,020
Dow Jones10 minn/a 2,36968.1711,843 EUR-6,017
Dow Jones15 minn/a 1,98969.7811,649 EUR-7,534
Nasdaq 100Dailyn/a 11372.5711,578 EUR-6,059
FTSE 100Dailyn/a 12774.809,874 EUR-2,902
DAX 404 hoursn/a 36567.409,823 EUR-5,837
Nasdaq 10030 minn/a 2,51464.967,877 EUR-5,344
FTSE 1001 hourn/a 1,42270.186,913 EUR-2,542
Nasdaq 10015 minn/a 2,36468.616,093 EUR-5,757
S&P 5004 hoursn/a 37871.963,952 EUR-1,205
FTSE 1004 hoursn/a 33467.662,933 EUR-2,782
FTSE 10010 minn/a 2,39566.012,209 EUR-2,179
S&P 50030 minn/a 2,50966.961,792 EUR-1,286
GoldDailyn/a 15261.841,293 EUR-856

Charts

Results by run

Top 10 of 29 runs. The full list is in the table above.

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Percent B Zero Cross Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE pctb = 0.5

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

13 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
Longer historyRe-run on up to 1,000,000 barsS&P 500 · Daily · older data 0.00 EUR

S&P 500 had no history beyond the standard run, so both runs used 14,000 bars.

S&P 500 · Daily

Bars available14,000
Net, standard 200,000-bar run4,790.40 EUR
Net, long run4,790.40 EUR
Net on the older data alone0.00 EUR
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Percent B Zero Cross Long 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 29 market and timeframe combinations. The best run was S&P 500, Daily, with a profit factor of 3.20 over 172 trades.

How large was the drawdown?

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

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

Lower Band Cross Long

Also a mean reversion strategy.

3.21 PF · 164 trades

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

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