Metric · Price and risk
Bollinger Bands Formula: Settings, %B and Bandwidth
Bollinger Bands put an envelope around price that widens when the stock gets volatile and narrows when it goes quiet. The width tells you as much as the touches do.
Formula
Middle band is the 20-period simple moving average; upper and lower bands are that average plus and minus two standard deviations of the same 20 closes
Bollinger Bands (20, 2): A volatility envelope drawn a set number of standard deviations above and below a moving average, so its width changes with how widely recent prices have been scattered.
Also shown as Bollinger Bands, %B, Bollinger bandwidth, Bollinger squeeze.
A stock closes on its upper Bollinger Band. Plenty of traders read that as overbought. Plenty of others read it as strength. Both can’t be right every time, and the reason neither reading is reliable on its own sits in how the bands are built.
Building the bands
Three lines. The middle one is a 20-period simple moving average of closes. The upper band is that average plus two standard deviations of the same 20 closes. The lower band is the average minus two.
Standard deviation measures how scattered the closes are around their average. Quiet stretch, small deviation, narrow bands. Volatile stretch, large deviation, wide bands.
The arithmetic is easier to follow with five closes, so the example below shrinks the period from 20 to 5, but every step is the same at 20, only with more numbers to add, square and average before taking the square root at the end.
Most charts divide by the number of closes, as here. Some tools divide by one fewer, the sample version of the formula, which gives slightly wider bands and is one reason two platforms can draw the same stock’s bands a few cents apart.
%B: where price sits inside the bands
%B turns position into a number. It’s the close minus the lower band, divided by the distance between the bands.
A %B of 1 means price is on the upper band. Zero means the lower band. Above 1 or below 0 means price has closed outside. Because it’s a ratio, %B lets you compare stocks with very different prices and screen for them, which the raw bands can’t do.
Bandwidth and the squeeze
Bandwidth is the distance between the bands as a share of the middle band. It falls when volatility contracts.
Very low bandwidth compared with the stock’s own history is called a squeeze. Quiet periods tend not to last, and a squeeze often comes before a larger move, which is why some traders scan for the narrowest bandwidth readings in months and then wait for a close outside the bands to show which way the move is going, without guessing the direction in advance.
The squeeze says a move may come. It says nothing about direction.
What a band touch means
It depends on the trend. In a range, closes at the upper band often turn back toward the middle, and the band works as a rough ceiling. In a strong uptrend, price can ride the upper band for weeks, touching it again and again while the average climbs underneath, and a trader who sold every touch would have been out of the stock long before the trend ended.
So a touch isn’t a sell signal. Check what the middle band is doing. Flat middle, range behavior is more likely. Rising middle with expanding bands, the trend has momentum. RSI adds a second opinion on how stretched the move is.
Bands and ATR
Both measure volatility. They measure it differently. Average true range is the typical size of a bar in dollars, gaps included, and it’s the better tool for placing a stop or sizing a position. Bollinger Bands measure how far closes have scattered from their average, and they’re better for seeing where price sits relative to recent behavior. One describes the size of the swings. The other describes the location of the price.
Where tools differ
- Average type. The default is a simple average. Some platforms let you switch to exponential, which changes both the middle and the bands.
- Deviation formula. Population or sample, as above.
- Multiplier. Two is standard. Settings around 2.5 for longer periods or 1.5 for shorter ones appear on some charts.
- Price input. Closes are standard; typical price is an option on some tools.
Using them well
Start by reading the width, then the position. A narrow band tells you the stock has gone quiet and might not stay that way. A close outside a wide band tells you something unusual happened, and the 50 and 200-day moving averages tell you whether it happened with the longer trend or against it.
Then check the count. On your own chart, see how often closes actually land outside the bands for this stock, because that’s a better guide than any textbook percentage. The rest of the price and risk fields are in metrics.
Related questions
What are the standard Bollinger Bands settings?
A 20-period simple moving average with bands two standard deviations above and below it. Some traders widen the multiplier on longer periods or narrow it on shorter ones, but 20 and 2 are the defaults on most charts.
Do Bollinger Bands contain 95% of prices?
That figure comes from the normal distribution, where about 95% of values fall within two standard deviations. Stock returns are not normally distributed and the bands move every bar, so the share of closes inside them varies by stock and period. Count it on your own chart instead of assuming it.
Are Bollinger Bands the same as Keltner Channels?
No. Keltner Channels set their width from average true range instead of standard deviation, and usually center on an exponential average. They tend to be smoother. Some traders plot both and watch for the Bollinger Bands moving inside the Keltner Channels as a sign of a squeeze.