Bollinger Bands are a volatility envelope drawn around a moving average. John Bollinger developed them in the early 1980s. Unlike fixed-percentage envelopes, the bands widen when the market becomes volatile and narrow when it calms down, so they adapt to each stock and each period.
How Bollinger Bands are calculated
Middle band = SMA(20) of the close
Upper band = Middle band + 2 × standard deviation(20)
Lower band = Middle band - 2 × standard deviation(20)
Two related indicators come from the same calculation:
- %B shows where price is within the bands: 1 at the upper band, 0.5 at the middle, 0 at the lower band. Values above 1 or below 0 mean price closed outside the bands.
- Bandwidth is the distance between the bands as a percentage of the middle band. It measures volatility directly.
How to read Bollinger Bands
- The squeeze. When bandwidth falls to a multi-month low, volatility is unusually quiet. Quiet periods tend to be followed by strong moves, so a squeeze flags stocks that may be about to break out. It doesn’t say in which direction.
- Walking the bands. In a strong trend, price can ride along the upper (or lower) band for weeks. A tag of the band in a trend is a sign of strength, not a sell signal.
- Mean reversion in ranges. In a sideways market, price tends to swing between the bands. Traders buy near the lower band and sell near the upper one, with the middle band as the first target.
- Closes outside the bands. With 2 standard deviations, most closes fall inside the bands. A close outside is unusual and worth attention, but in a trend it often marks continuation rather than reversal.
- Confirmation. Bollinger himself recommends pairing the bands with an indicator that is not based on the same data, such as a volume or momentum indicator.
Settings and common mistakes
- Settings. 20 periods and 2 standard deviations are the defaults. With a shorter period, narrow the bands slightly (about 1.9); with a longer one, widen them (about 2.1).
- Treating every band touch as a reversal. Touches mean price is high or low relative to recent volatility, not that it must turn.
- Ignoring the trend. Mean-reversion trades at the bands work in ranges and fail in trends. Check the slope of the middle band first.
For a practical way to combine the bands with local peaks and Fibonacci levels, see our article Bollinger Bands, Local Peaks and Fibonacci Levels.

Live chart: SPY (S&P 500 ETF), daily, with Bollinger Bands(20,2). The chart updates every trading day.
Screen for it on MarketInOut
Our formula language has bbub, bbmb and bblb for the bands, pb for %B, bb for bandwidth, and squeeze events. Stocks in a Bollinger squeeze:
exch(nyse,nasdaq) and type(stock) and price > 1 and advol(21) > 1
and bbands(20,2) squeeze
Stocks whose bandwidth is below 5%, a very tight range:
exch(nyse,nasdaq) and type(stock) and price > 1 and advol(21) > 1
and bb(20,2) < 5
Related: Average True Range, Moving averages, Relative Strength Index.