Join today
Strategies / Mean reversion / Smoothed Bollinger

Smoothed Bollinger: A Filtered Mean Reversion System

A smoothed Bollinger %b, built from a zero-lag Heikin-Ashi close and a TEMA, spots dips below 30 above the 220-day SMA and spikes above 90 below it. Trades use a 5% stop, 10% target, an ATR trailing stop, and a time exit for losing trades.

Mean reversionLong & shortSwingNasdaq 100Daily
1.66Profit factor
13,584Net profit EUR
71.95%Win rate
492Trades
-3,078Max drawdown
27.61Avg trade

Best run of 21. Nasdaq 100, Daily, spread 3, from run pf:2026-09-15-NAS100-D.tsv:1.

Entry rules, long

  1. Close is above the 220-day simple moving average
  2. Members only
  3. No position is open

Entry rules, short

  1. Close is below the 220-day simple moving average
  2. Members only
  3. No position is open

Exit rules

  1. Stop loss at 5% from entry
  2. Profit target at 10% from entry
  3. Members only
  4. Close a losing long after 16 bars
  5. Close a losing short after 2 bars

Test conditions

PeriodUp to 2026-09-15
InstrumentNasdaq 100, Daily
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-16

Parameters

positionSize
Contracts per trade
1
trendFilterOn
1 = only trade with the long-term average, 0 = off
1
trailingOn
1 = use the ATR-scaled trailing stop, 0 = off
1
stopLossPct
Protective stop, percent of entry price
5
takeProfitPct
Profit target, percent of entry price
10
longTrailFactor
Trailing distance for longs, in scaled ATR units
9
shortTrailFactor
Trailing distance for shorts, in scaled ATR units
4
atrTrailPeriod
ATR length for the trailing distance
200
minTrailPoints
Minimum trailing distance
5
maxLosingBarsLong
Close a losing long after this many bars
16
maxLosingBarsShort
Close a losing short after this many bars
2
trendPeriod
Trend filter SMA length
220
bandPeriod
%b standard deviation and average length
17
temaPeriod
TEMA smoothing length
8
oversoldLevel
Buy when %b is below this
30
overboughtLevel
Sell short when %b is above this
90

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best runDaily1.66 49271.9513,584 EUR-3,078
S&P 500Daily1.48 51563.302,671 EUR-983
Dow JonesDaily1.41 50671.1518,609 EUR-7,365
DAX 40Daily1.37 55566.319,989 EUR-3,831
EUR/USD2 min1.35 5,69022.04147,182 USD-95,915
FTSE 100Daily1.35 39172.634,926 EUR-1,460
EUR/USD3 min1.29 6,19027.21101,696 USD-69,006
Gold4 hours1.25 85647.781,808 EUR-917
EUR/USDDaily1.24 55074.1845,379 USD-19,978
Nikkei 225Daily1.24 39771.0320,214 USD-8,103
Nasdaq 1004 hours1.24 90555.148,644 EUR-2,716
S&P 5004 hours1.22 86350.292,118 EUR-682
Dow Jones30 min1.16 1,64127.2417,372 EUR-8,859
Dow Jones4 hours1.15 29848.667,615 EUR-6,958
DAX 404 hours1.15 85453.407,412 EUR-2,818
Gold5 min1.14 3,14113.531,588 EUR-745
Dow Jones1 hour1.08 94132.207,342 EUR-5,710
GBP/USD4 hours1.07 2,05464.952,456 USD-2,275
EUR/USD5 min1.00 6,36629.04-1,346 USD-40,289
Silver30 min0.82 5,31032.20-46,708 USD-51,178
CAC 40Dailyn/a 37568.271,990 EUR-1,678

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.00.51.01.52.01.0 = break-evenNasdaq 100 · Daily1.66S&P 500 · Daily1.48Dow Jones · Daily1.41DAX 40 · Daily1.37EUR/USD · 2 min1.35FTSE 100 · Daily1.35EUR/USD · 3 min1.29Gold · 4 hours1.25EUR/USD · Daily1.24Nikkei 225 · Daily1.24Nasdaq 100 · 4 hours1.24S&P 500 · 4 hours1.22Dow Jones · 30 min1.16Dow Jones · 4 hours1.15DAX 40 · 4 hours1.15Gold · 5 min1.14Dow Jones · 1 hour1.08GBP/USD · 4 hours1.07EUR/USD · 5 min1.00Silver · 30 min0.82

Net profit against max drawdown

Net profitMax drawdown
0-100K-50K100K200KEUR/USD · 2 minEUR/USD · 3 minEUR/USD · DailyNikkei 225 · DailyDow Jones · DailyDow Jones · 30 minNasdaq 100 · DailyDAX 40 · DailyNasdaq 100 · 4 hoursDow Jones · 4 hoursDAX 40 · 4 hoursDow Jones · 1 hourFTSE 100 · DailyS&P 500 · DailyGBP/USD · 4 hoursS&P 500 · 4 hours

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.

// ============================================================
// Smoothed Bollinger
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: Daily
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = true
DEFPARAM PreloadBars = 10000

// --- Parameters ---
positionSize = 1            // contracts per trade
trendFilterOn = 1           // 1 = only trade with the long-term average, 0 = off
trailingOn = 1              // 1 = use the ATR-scaled trailing stop, 0 = off
stopLossPct = 5             // protective stop, percent of entry price
takeProfitPct = 10          // profit target, percent of entry price
longTrailFactor = 9         // trailing distance for longs, in scaled ATR units
shortTrailFactor = 4        // trailing distance for shorts, in scaled ATR units
atrTrailPeriod = 200        // ATR length for the trailing distance
minTrailPoints = 5          // minimum trailing distance
maxLosingBarsLong = 16      // close a losing long after this many bars
maxLosingBarsShort = 2      // close a losing short after this many bars
trendPeriod = 220           // trend filter SMA length
bandPeriod = 17             // %b standard deviation and average length
temaPeriod = 8              // TEMA smoothing length
oversoldLevel = 30          // buy when %b is below this
overboughtLevel = 90        // sell short when %b is above this

// --- Indicators ---
// ATR of a scaled price series, kept exactly as the tested code computes it.
atrTrail = AverageTrueRange[atrTrailPeriod]((close/10)*PipSize)/1000
longTrailDistance = round(atrTrail*longTrailFactor)
shortTrailDistance = round(atrTrail*shortTrailFactor)

trendMA = Average[trendPeriod](close)
trendUp = (close > trendMA OR NOT trendFilterOn)
trendDown = (close < trendMA OR NOT trendFilterOn)

// Heikin-Ashi style close, fed through a zero-lag TEMA.
// The second term of haOpen has no /4, exactly as in the tested code.
haOpen = ((Open[1]+High[1]+Low[1]+Close[1])/4 + (Open[2]+High[2]+Low[2]+Close[2]))/2
haClose = ((Open+High+Low+Close)/4 + haOpen + max(high, haOpen) + min(low, haOpen))/4
temaFirst = TEMA[temaPeriod](haClose)
temaSecond = TEMA[temaPeriod](temaFirst)
temaGap = temaFirst - temaSecond
zeroLagHA = temaFirst + temaGap
smoothedZeroLag = TEMA[temaPeriod](zeroLagHA)

// Bollinger %b of the smoothed series.
percentB = (smoothedZeroLag + 2*STD[bandPeriod](smoothedZeroLag) - WeightedAverage[bandPeriod](smoothedZeroLag)) / (4*STD[bandPeriod](smoothedZeroLag))*100

61 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • Silver 30 minutes ended at USD -46,708.00 with a USD 51,177.50 drawdown, and EUR/USD 5 minutes was flat to negative.
  • Intraday EUR/USD runs show big numbers but also big drawdowns, such as USD 95,915.00 on the 2 minute chart.
  • The code keeps two quirks from testing: the Heikin-Ashi open misses a divide by 4, and the minimum trail distance is measured two different ways.
  • With 16 settings there is a real risk the chosen values fit past data more than future data.

Indicators used

Heikin AshiTEMABollinger BandsSMAATR

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 in ProOrder?

Yes, with 1 contract and one position at a time. The rewritten code has not been compile checked.

Which markets were tested?

Indices, gold, silver and currency pairs from 2 minutes to daily, and all but two runs were profitable. Dow Jones Daily made EUR 18,609.30 with a profit factor of 1.41.

How much drawdown at 1 contract?

On Nasdaq 100 Daily the maximum drawdown was EUR 3,077.50 against EUR 13,584.40 net profit.

Why daily charts?

The 220-day trend filter and percent based stops fit daily bars best. The daily index runs had higher profit factors than most intraday runs.

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

False Breakout SuperTrend

A similar profit factor.

1.65 PF · 154 trades

Want the next round of filtered mean reversion tests? Join 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