Bollinger Bands explained: settings, the squeeze, %b and their limits
Bollinger Bands are a moving average with a volatility envelope around it. Here is how the 20, 2 settings are calculated, what a squeeze and walking the bands really show, and why touching a band is not a signal.
- Bollinger Bands are a 20-period simple moving average with bands two standard deviations above and below it; the bands widen when volatility rises and narrow when it falls.
- A touch of the upper or lower band is not a buy or sell signal; in a strong trend price can walk along a band for a long time.
- A squeeze, when the bands are unusually narrow, shows that volatility has contracted; it does not say which way the next move will go.
- %b shows where price sits within the bands and bandwidth shows how wide they are; both are descriptions of past prices.
- Mean-reversion and breakout uses of the bands contradict each other, so any rule you build needs testing on data you did not use to design it.
Bollinger Bands are a volatility envelope drawn around a moving average. The standard settings are a 20-period simple moving average in the middle, with an upper and lower band two standard deviations above and below it. When price swings widely the bands spread apart; when the market goes quiet they contract. They describe where price has been relative to its own recent average and volatility; they do not tell you where it will go.
The bands are popular because they look informative: price seems to bounce between them, and the narrow periods seem to come before big moves. Both observations are partly true and partly a trick of hindsight. This guide covers how the bands are built, how traders use them, and where those uses break down.
Where Bollinger Bands come from
The bands were developed by John Bollinger in the early 1980s and set out in detail in his 2001 book Bollinger on Bollinger Bands. Earlier traders had drawn fixed percentage envelopes around moving averages. Bollinger's change was to make the width of the envelope depend on volatility, measured by standard deviation, so the bands adapt to the market instead of staying a fixed distance from the average.
How Bollinger Bands are calculated
There are three lines:
- Middle band: a simple moving average of the closing price, usually over 20 periods. If moving averages are new to you, trend following and moving averages explains how they work and why they lag.
- Upper band: the middle band plus a multiple (usually 2) of the standard deviation of the same 20 closes.
- Lower band: the middle band minus the same amount.
Standard deviation measures how spread out the closes are around their average. If the last 20 closes were all close to their mean, the standard deviation is small and the bands are tight. If the closes were scattered, the standard deviation is large and the bands are wide.
Population or sample standard deviation?
There are two common ways to calculate standard deviation. The population version divides the sum of squared deviations by the number of values (N); the sample version divides by one less (N − 1). Bollinger specifies the population version, and most charting platforms follow that. The difference is small at 20 periods, but it explains why bands drawn in a spreadsheet using a sample function can be slightly wider than the bands on your chart.
Why 20 and 2?
The 20-period average roughly matches a month of trading days on a daily chart, and two standard deviations is a familiar statistical distance. Bollinger's own guidance pairs a shorter look-back with a slightly narrower multiple and a longer look-back with a slightly wider one, but 20 and 2 remain the defaults on MetaTrader, cTrader and TradingView. These are conventions, not optimised values, and changing them changes how often price reaches the bands.
A common misunderstanding is that two standard deviations means price stays inside the bands about 95% of the time. That figure comes from the normal distribution, and market returns are not normally distributed; they have more extreme moves than a bell curve predicts. In practice the share of closes inside the bands varies with the market, the timeframe and the period you measure, so treat any fixed percentage you see quoted with suspicion.
Worked example: calculating the bands
To keep the arithmetic readable, this example uses a 5-period average with 2 standard deviations rather than 20 periods. The method is identical; only the window is shorter. Illustrative GBP/USD daily closes:
- 1.2500, 1.2530, 1.2510, 1.2550, 1.2560
Step 1, the middle band. Sum = 6.2650. Divide by 5: middle band = 1.2530.
Step 2, deviations from the mean, in pips. 1.2500 is 30 pips below, 1.2530 is 0, 1.2510 is 20 below, 1.2550 is 20 above, 1.2560 is 30 above. So the deviations are −30, 0, −20, +20, +30.
Step 3, square them. 900, 0, 400, 400, 900. Sum = 2,600.
Step 4, population variance. 2,600 / 5 = 520.
Step 5, standard deviation. The square root of 520 is about 22.8 pips.
Step 6, the bands. Two standard deviations = 45.6 pips.
- Upper band = 1.2530 + 0.00456 = about 1.2576
- Lower band = 1.2530 − 0.00456 = about 1.2484
If you had used the sample version instead, dividing 2,600 by 4, the standard deviation would be about 25.5 pips and the bands would sit at roughly 1.2581 and 1.2479, a few pips wider each side. With 20 values instead of 5, the gap between the two methods shrinks.
Notice what the calculation contains: the last few closes and nothing else. No economic data, no positioning, no information about what comes next.
%b and bandwidth
Bollinger introduced two derived measures that turn the picture on the chart into numbers.
%b: where price sits within the bands
- %b = (price − lower band) / (upper band − lower band)
A %b of 1 means price is on the upper band, 0 means it is on the lower band, and 0.5 means it is on the middle band. Values above 1 or below 0 mean price is outside the bands.
Using the example above, the latest close is 1.2560. Price minus lower band = 1.2560 − 1.24844 = about 75.6 pips. The width of the bands is 91.2 pips. So %b = 75.6 / 91.2 = about 0.83: price is in the upper part of the envelope but still inside it.
%b is useful because it is comparable across markets and across time in a way raw band levels are not, and because it can be used in written rules ("%b above 1"), which makes them easier to test.
Bandwidth: how wide the bands are
- bandwidth = (upper band − lower band) / middle band
In the example, 91.2 pips divided by 1.2530 gives about 0.0073, or 0.73% of price. Bandwidth on its own means little; what matters is how it compares with the same market's past readings. A bandwidth that is the lowest it has been for several months is what traders call a squeeze.
The squeeze
When volatility contracts, the bands narrow. Bollinger observed that periods of low volatility tend to be followed by periods of higher volatility, and vice versa, and the squeeze is the setup built on that idea: an unusually low bandwidth reading suggests the market is quiet and may not stay quiet.
What the squeeze tells you:
- Recent closes have been tightly clustered.
- Volatility has fallen relative to its own recent history.
What it does not tell you:
- Direction. A squeeze can resolve upwards or downwards. Bollinger himself warned about the head fake, where price breaks one way out of a squeeze and then reverses sharply the other way.
- Timing. A market can stay quiet for much longer than looks likely, especially in holiday periods or before a major scheduled event.
Squeezes in currency markets often coincide with the calendar: the days before a central bank decision or a big data release can be quiet, and the release itself breaks the range. In that situation the squeeze is a description of traders waiting, and the next move depends on the data, not on the bands. Spreads can also widen sharply around releases, which matters for anyone trying to enter on the break; see how to use an economic calendar.
Walking the bands
In a strong trend, price can close at or beyond the upper band again and again, with the bands widening and rising alongside it. Traders call this walking the bands. It is the reason a band touch is not a sell signal: in a trending market, touches of the upper band are a symptom of strength, not exhaustion.
Illustrative scenario: EUR/USD rises steadily for three weeks after a shift in interest-rate expectations. On most days price closes in the top quarter of the envelope and %b sits between 0.8 and 1.1. A trader who sells every close above the upper band takes a string of losses while the trend continues. A trader who buys every close above the band does well in this stretch, and then takes a string of losses in the next sideways month, when touches of the band are followed by moves back to the middle. The bands looked the same at each touch. What differed was the market regime, which the bands only show after the fact.
Two opposite ways to use the bands
Most Bollinger Band methods fall into one of two camps, and they contradict each other.
Mean reversion
The idea: in a range, price tends to return to the middle band after reaching an outer band. So a close below the lower band, or a close back inside it after being outside, is treated as a possible long; the mirror image as a possible short; and the middle band as a natural exit.
This tends to look good in sideways markets and fail badly in trends, because in a trend the outer band keeps moving away and the expected return to the middle does not come. Mean-reversion rules usually need a filter for the regime (for example, only trading when bandwidth is low and the middle band is flat) and a hard stop beyond the band. Combining the bands with horizontal levels from support and resistance is a common way to add context, though not certainty.
Breakout and trend
The idea: a close outside the bands after a squeeze shows that volatility is expanding in that direction, so it is treated as a possible entry in the direction of the break, with the middle band or the opposite band as a trailing exit.
This tends to look good in trends and suffer in ranges and head fakes, where the break reverses. It is essentially a trend-following approach and inherits the trade-off described in the moving averages guide: many small losses in exchange for occasional larger moves.
Neither use is right in general. Which one appears to work depends on the period and market you look at, and it is easy to pick examples that flatter either. The only honest way to judge a rule is to define it precisely and test it on data you did not use to build it; see how to backtest a strategy.
Bollinger Bands with RSI
A popular combination is Bollinger Bands with RSI: for example, only treating a lower-band touch as a possible long if RSI is also below 30. The intention is confirmation. The catch is that both are calculated from the same recent closes. A sharp fall to the lower band will very often push RSI down at the same time, so the two agree for the same mechanical reason. You get fewer signals, which may or may not help, but not independent evidence.
Bollinger's own suggestion was to pair the bands with indicators that use different inputs, such as volume-based measures, rather than another price-only oscillator. In spot forex there is no central volume figure, which limits that option. If you want to understand what RSI adds and what it repeats, read RSI and MACD explained; the stochastic oscillator guide covers another momentum tool with the same caveat.
Settings and timeframes
Changing the settings changes the character of the bands:
- Shorter period (for example 10): bands follow price closely and react quickly; more touches and more noise.
- Longer period (for example 50): smoother, slower bands; fewer touches.
- Wider multiple (for example 2.5): fewer closes outside the bands.
- Narrower multiple (for example 1.5): many more closes outside the bands.
The same settings mean different things on different timeframes. Bands on a 5-minute chart cover less than two hours of price; on a daily chart they cover about a month. As with any indicator, searching for the settings that would have worked best last year is a reliable way to overfit. Pick settings for a reason, keep them fixed, and judge the rule on new data.
Using the bands for risk, not just entries
The bands can be useful in risk management because they are a visual of volatility. Wide bands mean the market has been moving a lot, which usually means wider stops and therefore smaller positions to keep the money at risk the same. For a numeric measure of the same thing that translates directly into stop distances, see the ATR indicator guide; for the sizing arithmetic, use position sizing and the position size calculator.
Illustrative example: if a trader's mean-reversion rule buys near a lower band and places the stop a fixed distance beyond the band, the stop distance will be much larger when the bands are wide. On a USD 5,000 account risking 1% (USD 50), a 30-pip stop on EUR/USD allows about 0.16 lots at roughly USD 10 per pip per standard lot (50 / (30 × 10) = 0.167, rounded down), while a 70-pip stop allows only 0.07 lots (50 / (70 × 10) = 0.071, rounded down). The bands changed the stop; the sizing kept the risk in line.
Limits of Bollinger Bands
- They lag. The middle band is a moving average and the width is based on the same past closes. The bands react after a move has started.
- They are built from closes only. Intrabar spikes that reverse before the close do not affect the calculation directly, although they show on the chart.
- Standard deviation assumes more regularity than markets have. Sudden jumps, for example on central bank surprises, can carry price far outside the bands in a single bar.
- They do not see news. A squeeze before a scheduled release tells you traders are waiting, not what the release will show.
- They look better in hindsight. Textbook charts are chosen because the bands worked on them.
Common mistakes
- Treating a band touch as a reversal signal. Price can walk along a band through a whole trend.
- Assuming a squeeze predicts direction. It describes low volatility, nothing more. Head fakes are common.
- Stacking price-only indicators. Bands plus RSI plus stochastic are three views of the same closes.
- Ignoring the middle band. It is a 20-period moving average with all the lag that implies.
- Optimising the settings on past data. It produces rules that look strong on the chart you used and weaker elsewhere.
- Forgetting costs and leverage. Frequent band trades mean frequent spreads and commissions, and leverage magnifies losses. Most retail CFD accounts lose money; see why most retail CFD traders lose.
For quick definitions, see the glossary entries for Bollinger Bands and volatility.
Frequently asked questions
What are Bollinger Bands?
Bollinger Bands are three lines on a price chart: a moving average in the middle, usually 20 periods, and two outer bands set a multiple of the standard deviation of recent closes above and below it, usually two. The bands widen when volatility rises and narrow when it falls.
What are the standard Bollinger Band settings?
The defaults are a 20-period simple moving average and bands at two standard deviations, often written as 20, 2. They are conventions chosen by John Bollinger, not optimised values, and they work the same way on any timeframe.
What does a Bollinger Band squeeze mean?
A squeeze is when the bands are unusually narrow compared with their recent history, showing that volatility has contracted. Low volatility is often followed by higher volatility, but the squeeze does not tell you which direction the next move will take, and false breaks are common.
Is touching the upper Bollinger Band a sell signal?
No. A touch of the upper band means price has risen to two standard deviations above its 20-period average. In a strong trend price can stay near the upper band for a long time, so treating every touch as a sell signal can lead to repeated losses.
What is %b in Bollinger Bands?
%b shows where price is relative to the bands. A value of 1 means price is on the upper band, 0 means it is on the lower band and 0.5 means it is on the middle band. Values above 1 or below 0 mean price is outside the bands.
Do Bollinger Bands work in forex?
They work as a description of volatility and of where price sits relative to its recent average, on any market with price data. Whether a trading rule built on them works is a separate question that depends on the rule, the pair, the timeframe and costs, and can only be judged by testing.
Not investment advice. This is general information and education, written without knowledge of your circumstances. It is not a recommendation to buy or sell any instrument. Past performance is not a reliable indicator of future results. Trading leveraged products carries a high risk of losing money. Risk warning