volatility indicator
Bollinger Bands backtesting — Bollinger Bands
Bollinger Bands wrap a moving average in an envelope that widens when volatility rises and tightens when it falls. Price touching or crossing a band is one of the most-traded signals in technical analysis — and one of the most misused, because a band touch means very different things in trends and in ranges. Backtesting shows which one your market is.
How Bollinger Bands works
The middle band is a simple moving average of closing prices. The upper and lower bands sit a chosen number of standard deviations above and below it, computed over the same window. Because standard deviation grows with volatility, the bands automatically widen in fast markets and contract in quiet ones — a squeeze (unusually narrow bands) often precedes a volatility expansion. CandleTest’s implementation matches TradingView’s, so band values line up candle-for-candle. Common testable readings: price closing below the lower band (stretched down), price closing above the upper band (stretched up), and price crossing back through either band as a reversion exit.
Bollinger Bands settings
The moving-average and standard-deviation window. Longer windows produce slower, wider-swinging bands; shorter windows hug price more tightly.
How many standard deviations the bands sit from the middle. Higher multipliers mean fewer, more extreme band touches; lower multipliers generate frequent signals.
Example Bollinger Bands strategies to backtest
Enter long when the close crosses below the lower band. Exit when the close crosses back above the lower band — a bounce back inside the bands.
Enter long when the close crosses above the upper band — strong trends ride the upper band rather than reverting. Exit when the close crosses back below the upper band, signaling the ride has stalled.
Every rule above is buildable in the no-code strategy builder — pick conditions, press run, and get win rate, drawdown and equity curve on real exchange data with fees and leverage modeled.
Bollinger Bands FAQ
Is a lower band touch a buy signal?
Not by itself. In a range, price touching the lower band often reverts to the mean; in a downtrend, price can walk down the lower band for weeks. Backtest the rule with and without a trend filter (such as price above a long moving average) and compare — the difference is usually dramatic.
What do the band settings actually change?
The length controls how fast the middle line follows price, and the multiplier controls how rare a band touch is. Tightening either produces more signals of lower quality; loosening produces fewer, more extreme ones. Which trade-off pays is an empirical question a backtest answers directly.
What is a Bollinger Band squeeze?
A period when the bands become unusually narrow because volatility has dried up. Squeezes often precede large moves, but the direction is not predicted by the squeeze itself — traders usually pair it with a breakout rule in either direction.