Buy after three closes below the lower Bollinger band
Bollinger %b: buy when %b is below 0 three days in a row and sell when it is above 0.8.
Survivorship mirage
It clears the bar on today's winners, the stocks everyone wishes they had bought, but not on the laggards, which is where hindsight can't help.
- It clears the bar on today's winners but not on the laggards: the winners' own rise did the work.
42 large US stocks, 15 years
Before costs +0.065R
By trade and by day, sized to a first try
What the numbers say
On the 22 laggards the rule averaged −0.009R per trade after costs over 1124 trades, against 0.176 on today's winners. It was positive only in bear markets (0.172R); in bull and flat markets it was negative (−0.033 and −0.079). The gain on winners did not carry over to laggards, so their rise did the work.
How it was tested
Buy at the close after Bollinger %b has been below 0 for three consecutive days, and exit when %b rises above 0.8.
- Side
- Long
- Its own exit
- Exit at the first close after entry where Bollinger %b (20, 2) is above 0.8., checked at each close
- Time limit
- Exit at the close after 30 trading days, unless the stop, the target or its own exit comes first
- Bar to clear
- t > 2.01, by trade and by day, sized to a first try (one idea, tested once)
- Prices
- 15 years of daily bars through 2026-11-20; judged 2026-11-22
- Bollinger bands use a 20-day SMA with 2 standard deviations
- %b computed on closing prices
- Three days in a row means three consecutive daily closes with %b below 0, including the signal day
- Sell when %b is above 0.8 is implemented as the exit_rule, checked at each close after entry
- Stop (3 x ATR(14)) and target (6 x ATR(14)) are protective choices since the idea names none
- Time limit set to the 30-day maximum since the idea names none
The evidence
The laggards decide: 22 large stocks that lagged or fell, where hindsight can't flatter a rule. Today's winners sit beside them to show what survivorship would add.
| Market | Trades | Per trade | t, by trade | t, by day | Random dates | Winners, per trade |
|---|---|---|---|---|---|---|
| Bull | 664 | −0.033R | −0.95 | −2.21 · 460d | −0.059R · beats 85% | +0.206R |
| Flat | 268 | −0.079R | −1.40 | −1.21 · 152d | −0.063R · beats 40% | +0.060R |
| Bear | 192 | +0.172R | 2.72 | 0.87 · 78d | +0.012R · beats 100% | +0.285R |
| All | 1,124 | −0.009R | −0.048R | +0.176R |
R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 14.5 bps) plus 0.045R for the fills a real order wouldn't get. “By day” groups trades opened the same day, so a rule that fires on the same dates for every stock counts as a few events. “Random dates” places the same plan on random days of the same stocks in the same kind of market, 20 times; the idea must beat 95% of those draws.
The scanner we wroteShow the codeHide
from decimal import Decimal
import math
from core.domain import Bar
from strategies.indicators import atr
from scanners.base import Candidate
class BollingerPctbThreeBelowLowerBandLong:
name = "bollinger_pctb_three_below_lower_band_long"
description = "Long after three consecutive closes with Bollinger %b below 0; exit when %b above 0.8."
def __init__(self, period: int = 20, num_std: float = 2.0, consecutive: int = 3,
atr_period: int = 14, stop_mult: float = 3.0, target_mult: float = 6.0,
exit_level: float = 0.8) -> None:
self._period = period
self._num_std = num_std
self._consecutive = consecutive
self._atr_period = atr_period
self._stop_mult = stop_mult
self._target_mult = target_mult
self._exit_level = exit_level
def _pctb_at(self, closes, end_idx):
# %b using the window of closes ending at index end_idx (inclusive)
n = self._period
if end_idx + 1 < n:
return None
window = [float(c) for c in closes[end_idx + 1 - n:end_idx + 1]]
mean = sum(window) / n
var = sum((x - mean) ** 2 for x in window) / n
sd = math.sqrt(var)
upper = mean + self._num_std * sd
lower = mean - self._num_std * sd
width = upper - lower
if width <= 0:
return None
return (window[-1] - lower) / width
def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
need = max(self._period + self._consecutive - 1, self._atr_period + 1)
if len(bars) < need:
return None
closes = [b.close for b in bars]
last = len(bars) - 1
for k in range(self._consecutive):
p = self._pctb_at(closes, last - k)
if p is None or p >= 0:
return None
atr_val = atr(bars, self._atr_period)
if atr_val is None or atr_val <= 0:
return None
atr_dec = Decimal(str(atr_val))
entry = bars[-1].close
stop = entry - Decimal(str(self._stop_mult)) * atr_dec
target = entry + Decimal(str(self._target_mult)) * atr_dec
risk = entry - stop
if risk <= 0 or stop <= 0:
return None
rr = (target - entry) / risk
return Candidate(
ticker=ticker,
side="buy",
entry=entry,
stop=stop,
target=target,
risk_reward_ratio=rr.quantize(Decimal("0.01")),
signal_strength=50,
thesis="Three consecutive closes below the lower Bollinger band (%b < 0); mean-reversion long.",
)
def exit_now(self, ticker: str, bars: list[Bar], entry: Decimal,
side: str, bars_held: int) -> bool:
if len(bars) < self._period:
return False
closes = [b.close for b in bars]
p = self._pctb_at(closes, len(bars) - 1)
if p is None:
return False
return p > self._exit_level
Hypothetical results from our own backtest of the rule as restated, on 42 large US stocks over 15 years. Past performance, real or simulated, does not predict future results. Research and education only; not investment advice.
Describe it in plain words and get the same honest test in about a minute.