Bollinger bands
A moving average of closes with bands a set number of standard deviations either side, showing how spread out recent prices are.
The middle line is the simple average of the last window closes, 20 bars by default. The upper and lower bands sit the multiplier times the standard deviation of those same closes above and below it, with the multiplier at 2.0 by default. The deviation is the sample version, so the bands widen when recent closes scatter and narrow when they bunch up.
How to read it
- The middle line sits on the price scale, so read it as a moving average of recent closes.
- The bands open up in fast moves and pinch together in quiet stretches, so their width is a volatility gauge.
- On the SPY month sampled, the bands sat only about 0.4 dollars from the middle at the median, roughly 0.05 percent of price.
- A run of closes riding the upper band shows a sustained push up, not a reversal signal on its own.
What it outputs
- Middle
- Simple average of the last window closes. The centre line of the bands.
- Upper band
- Middle plus the multiplier times the standard deviation of the same closes.
- Lower band
- Middle minus the multiplier times the same standard deviation.
Settings
- Window
- How many closes the average and spread cover. Shorter (around 5 to 10) makes the middle hug price and the bands jump with each bar. Longer (50 or more) makes the lines smooth and slow, and the bands sit wider in a trend because they measure a longer stretch.
- Multiplier
- Scales how far the bands sit from the middle. Higher (3 or more) draws wide bands that price touches rarely. Lower (1 or below) draws tight bands that price touches often. The middle line does not change.
Pitfalls
- The bands use the sample standard deviation, dividing by N minus 1, so at window 20 they run about 2.6 percent wider than a population-based version.
- By default the bands are built from closes, so intraminute highs and lows do not move them.
- The bands describe past spread, not probability. In a strong trend price can ride one band for long stretches.