Bollinger Bands Explained: The Squeeze, %B, Bandwidth and Band Touches
Bollinger Bands are a 20 SMA ± 2 standard deviations. A worked example, %B, Bandwidth, the squeeze, walking the band, and why a touch is not a signal.
- Bollinger Bands are a 20 SMA plus and minus 2 standard deviations, so the bands widen and narrow with volatility
- Touching the upper or lower band is not a buy or sell signal. In a strong trend price can walk the band for a long time
- A squeeze says volatility is unusually low and often comes before a fast move, but it doesn't tell you the direction
- Decide first whether the market is trending or ranging, then choose how to read the bands
Bollinger Bands are a moving average with an upper and a lower band around it. The gap isn’t fixed: the bands widen when price swings hard and narrow when price goes quiet. So they answer two questions at once: is price high or low compared with its recent range, and is the market volatile or calm right now. John Bollinger developed the tool in the 1980s and it is still one of the most-used indicators on any chart. Like every indicator, the bands are calculated from past prices. They don’t predict the future.
The formula: 20 SMA plus and minus 2 SD
Bollinger Bands have three lines. The standard settings are 20 bars and 2 standard deviations.
- Middle band = 20 SMA, the average of the last 20 closes (more on SMAs in Moving averages)
- Upper band = middle band + 2 × SD
- Lower band = middle band − 2 × SD
SD (standard deviation) measures how far those 20 closes spread out around their average. When price swings hard, SD is large and the bands are wide. When price is quiet, SD is small and the bands are narrow. The standard formula divides by the number of bars (N), not N − 1. This is the population SD, and it is what MT5 and TradingView use by default.
If prices followed a textbook normal distribution, about 95% of them would sit inside 2 SD. Real prices don’t. Big moves happen far more often than that statistic expects, so treat the 95% as a rough picture, not as the odds that price returns inside the bands.
Worked example over 20 bars
Twenty made-up closes, oldest to newest:
100.0, 100.4, 100.2, 100.6, 100.9, 100.7, 101.0, 101.3, 101.1, 100.8, 101.2, 101.5, 101.4, 101.8, 101.6, 101.9, 102.2, 102.0, 102.4, 102.7
- Middle band: sum 2,025.7 ÷ 20 = 101.285
- Squared distance from the average for each bar. The first bar is (100.0 − 101.285)² = 1.6512, the last is (102.7 − 101.285)² = 2.0022. All 20 add up to 10.3255
- Variance: 10.3255 ÷ 20 = 0.5163
- SD: √0.5163 = 0.7185
- Upper band: 101.285 + 2 × 0.7185 = 102.722
- Lower band: 101.285 − 2 × 0.7185 = 99.848
The last close, 102.7, is almost exactly on the upper band, even though price only climbed gradually over the 20 bars with no unusual spike. That is a common sight in an uptrend. Dividing by 19 instead (sample SD) gives an SD of 0.7372 and slightly wider bands, so use the same method as the platform you are reading.
%B and Bandwidth: the bands as numbers
Bollinger proposed two numbers that let you read the bands without eyeballing them.
%B tells you where price sits inside the bands:
%B = (price − lower band) ÷ (upper band − lower band)
%B = 1 means price is exactly on the upper band, 0.5 is the middle line, 0 is the lower band. It can go above 1 or below 0, which means price closed outside the bands. In the example: (102.7 − 99.848) ÷ (102.722 − 99.848) = 2.852 ÷ 2.874 = 0.99
Bandwidth measures how wide the bands are relative to price, a gauge of volatility:
Bandwidth = (upper band − lower band) ÷ middle band
In the example: 2.874 ÷ 101.285 = 0.0284, or 2.84%. There is no fixed “high” or “low” value, because every market and timeframe has its own normal volatility. Only compare it with past values on the same chart.
The squeeze: tight bands often come before a fast move
Volatility comes in phases. Quiet stretches give way to fast moves, and fast moves settle back into quiet. A squeeze is when Bandwidth drops unusually low compared with that chart’s own history. Bollinger’s own yardstick is Bandwidth at its lowest level in about six months. Many traders see it as energy building up before price runs.
The key point: a squeeze has no direction. In the figure price breaks down, but another series could just as easily break up, and price often pokes out one side first and then runs the other way. Common approaches are to wait for real closes outside the bands, use the bigger trend to pick a side, and put the Stop loss on the far side of the narrow bands, which is a short distance because the bands have just tightened.
Walking the band in trends, reverting in ranges
The bands behave very differently depending on the market.
- In a range, price swings between the bands. A touch of the upper or lower band tends to fall back toward the middle line, and the middle line is flat
- In a trend, price walks the band: it tags or closes above the upper band several times in a row, the middle line points clearly up, and pullbacks usually don’t go much deeper than the middle line
A touch is not a signal. Tagging the upper band only means price is high compared with the last 20 bars, not that it is too expensive and must turn.
This is why traders who sell every upper-band touch get hurt in uptrends. A strong trend is exactly when price touches the band most often.
Add a trend filter
Since the bands read differently in trends and ranges, the first step is to decide which one you are in. Popular tools:
- The slope of the middle band and the 200 SMA. A flat middle line with price circling the 200 SMA usually means a range. A line pointing clearly one way usually means a trend
- ADX measures trend strength regardless of direction. Many traders treat ADX below about 20 as a range and above 25 as a trend. These are conventions, not fixed rules. More in ADX trend strength
- Oscillators like RSI can help in ranges, but watch for double counting, because RSI and %B measure something similar: how high or low price is compared with its recent past. See Combining indicators without redundancy and RSI
A rough rule: in a range, the band edges are where price often turns. In a trend, a band touch is evidence that the move still has strength, and the middle line is where price tends to pause.
Stop loss ideas from the bands
The bands already measure volatility, so they help you place a Stop loss far enough from normal noise. Common ideas:
- Range, enter at a band, target the middle line. Put the Stop loss some distance beyond the band, for example 1 SD. Using the example above: price touches the lower band at 99.848, the middle line at 101.285 is 1.437 away (= 2 SD), and a Stop loss at 99.848 − 0.7185 = 99.130 risks 0.7185. RR = 1.437 ÷ 0.7185 = 2. Remember the middle line moves every bar, so the real target moves too
- Trend, use the middle line as a trail. While price walks the band, many traders hold until price closes back through the middle line. That gives far more breathing room than exiting on a band touch
- After a squeeze, a Stop loss on the far side of the narrow bands is short, which keeps the risk per trade small, but it gets hit often when the breakout is a fake
Whichever you use, wider bands mean a farther Stop loss, so cut the lot size to keep the money at risk the same. See Position size from Stop loss. If you want volatility directly in price units, ATR is simpler. Read ATR and Stop loss.
When Bollinger Bands mislead
- When a range turns into a trend. Mean reversion that worked for weeks fails several trades in a row, because the new trend walks the band and doesn’t come back. More on markets changing character in Market regime change
- Big news. Price jumps far outside the bands and the bands only widen afterwards, because SD is calculated from prices that already happened
- Very tight bands in a dead market, such as around market closes or holidays. A squeeze caused by nobody trading doesn’t mean energy is building
- Small timeframes. The bands get so narrow that the distance to the middle line is close to the spread, and costs eat most of the profit
Common mistakes
- Selling because price touched the upper band, or buying because it touched the lower band, without checking whether the market is trending or ranging
- Guessing the direction during a squeeze, when the bands don’t give one
- Believing price stays inside the bands 95% of the time, so it must come back, and holding a losing trade too long
- Using %B, RSI and Stochastic together and counting them as three reasons, when they measure much the same thing
- Tweaking 20 and 2 until they fit past charts
- Forgetting to reduce the lot size when the bands are wide, so the farther Stop loss loses more money than planned
Frequently asked questions
Price touched the upper band. Should I sell?
Not for that reason alone. A touch only means the close is high compared with the last 20 bars. In a range price often drifts back to the middle line, but in an uptrend it can tag the upper band again and again and keep rising. Read the market first and place your Stop loss before anything else.
Can I change the 20 and the 2?
You can, but 20 and 2 are the standard values most traders use, so you see the same bands as the market. Tuning the numbers to fit past charts usually stops working in the future. If you change them, test across several periods first.
After a squeeze, which way will price go?
The bands don't say. A squeeze only tells you volatility is very low and tends to expand later. The first push out of the bands can still be a fake, so many traders wait for closes outside the bands or use a trend filter to pick a side.
This is general education, not investment advice. Trading is risky and you may lose all of your capital.