Indicators/Volatility

Bollinger Bands (BB)

A moving average with bands a set number of standard deviations above and below, widening and narrowing as volatility changes.

BB 20 2AMD · daily
BB on a daily AMD chart in StockVyze

What it measures

Bollinger Bands, developed by John Bollinger, place bands around a 20-bar simple moving average at a distance of two standard deviations of price (both adjustable). Because standard deviation measures how spread out recent closes are, the bands widen in volatile periods and contract in quiet ones.

OutputDefinition
middleSimple moving average of the close
upperMiddle band plus deviation standard deviations
lowerMiddle band minus deviation standard deviations

How to read it

  • Squeeze. Unusually narrow bands mark low volatility, which often precedes a larger move. The squeeze does not tell you the direction.
  • Walking the band. In strong trends price can ride along the upper or lower band; a touch of the band is not by itself a reversal signal.
  • Mean reversion. In ranges, moves to a band and back toward the middle are common, which is how many range traders use them.

Common mistakes

  • Selling every upper-band touch. Strong uptrends keep touching the upper band.
  • Ignoring the trend. Band signals behave very differently in trends and in ranges; decide which you are in first.

Use it in a scan

Price closing above the upper band:

c > bb_upper(20, 2)

A squeeze, with band width under 10% of the middle band:

(bb_upper(20, 2) - bb_lower(20, 2)) / bb_middle(20, 2) < 0.10

Inputs

InputTypeDefaultRange
periodinteger202 – 300
deviationnumber20.000001 – 10

Outputs

upper, middle, lower

References

  • John Bollinger, Bollinger Bands