Bollinger Bands Explained: Formula, Settings and a Tested Squeeze Signal

Bollinger Bands are a 20-period moving average with bands two standard deviations above and below. On a 20-bar hypothetical series the bands are 54.89 and 49.93 around 52.41. On 2,466 daily USD/CAD rates from 2017 to 2026, the 20-day move after a squeeze averaged 1.46% against 1.36% on all days, a gap too small to trade on.

What are Bollinger Bands and how are they calculated?

Bollinger Bands put a volatility envelope around a moving average. John Bollinger's own site gives the default settings as 20 periods for the moving average with the bands set at plus and minus two standard deviations, and says the standard deviation is computed on the same data used for the average, using the population calculation.

The formulas are: middle band = simple average of the last 20 closes; upper band = middle + 2 x standard deviation; lower band = middle - 2 x standard deviation. Two derived readings are common. Bandwidth is (upper - lower) / middle, which measures how wide the bands are. Percent b is (close - lower) / (upper - lower), which shows where the close sits inside the bands: 0 at the lower band, 1 at the upper band. Bollinger's page defines bandwidth as how wide the bands were as a function of the middle band; the percent b formula is the standard one and is shown here for the worked example.

Because the standard deviation measures spread around the average, the bands widen when prices swing and narrow when they are quiet. They are not a fixed percentage of price. They also do not predict direction: the bands say how volatile prices have been, not which way they will go next.

Worked example: bands on a 20-bar hypothetical series

This is a hypothetical series with invented prices, used only to show the arithmetic. The 20 closes are 50.2, 50.6, 51.0, 50.8, 51.3, 51.7, 51.4, 52.0, 52.3, 52.1, 52.6, 53.0, 52.7, 53.2, 53.6, 53.3, 53.9, 54.2, 53.8 and 54.5, a steady uptrend.

The sum is 1,048.2, so the middle band is 1,048.2 / 20 = 52.41. The population standard deviation of the 20 closes is 1.2409. The upper band is 52.41 + 2 x 1.2409 = 54.89 and the lower band is 52.41 - 2 x 1.2409 = 49.93. The last close of 54.50 is below the upper band, so there is no band break. Bandwidth is (54.89 - 49.93) / 52.41 = 9.47%, and percent b is (54.50 - 49.93) / (54.89 - 49.93) = 0.92.

Two details change the result. If you use the sample standard deviation (dividing by 19) the figure is 1.2732 and the upper band is 54.96, so check which your charting platform uses against Bollinger's population calculation. And a flat series gives very different bands: 20 closes between 51.9 and 52.2 have a middle of 52.03 and a standard deviation of 0.089, so the bands are 52.20 and 51.85 and bandwidth is 0.68%. That narrow, quiet state is the squeeze.

SeriesMiddle bandStandard deviation (population)Upper bandLower bandBandwidth
Uptrend (hypothetical)52.411.240954.8949.939.47%
Flat (hypothetical)52.030.088752.2051.850.68%

What is a Bollinger Band squeeze?

A squeeze is a period when bandwidth is unusually low relative to its own recent history. The idea is that quiet markets are followed by larger moves, so a squeeze flags that volatility may expand. It does not say whether the move will be up or down.

There is no single official threshold. Bollinger's page we read does not define the squeeze; it only defines bandwidth. For our test we used a mechanical rule: a squeeze is a day on which bandwidth is in the lowest 10% of its trailing 126 trading days, roughly six months. Another trader might choose a different lookback or cut-off, and the results could differ.

Does the squeeze work? A test on 2,466 days of USD/CAD

We tested the squeeze rule on the Bank of Canada's daily average USD/CAD exchange rate, 3 January 2017 to 20 November 2026, 2,466 observations. This is one series and one rate per day, not open-high-low-close data, so it is a simple check, not a trading backtest. We used 20-day bands with two population standard deviations. We measured the absolute move from the day's rate to the rate 20 trading days later.

On all 2,301 days with enough history, the average absolute 20-day move was 1.36% (median 1.14%). On the 275 squeeze days it was 1.46% (median 1.18%). Squeeze days overlap, so we also kept only the first squeeze day in each run, at least 20 days apart: 37 episodes, average move 1.45%, median 1.16%. Squeezes were followed by moves about 0.1 percentage points larger on average, which is small against the day-to-day noise.

For direction, we looked at the first close outside a band within 10 days of each of the 37 squeezes. That happened in 30 episodes. In 16 of them (53%) the rate was further in the same direction 20 days later. A coin flip gives 50%, and 30 events is far too few to separate the two. For the bandwidth itself, USD/CAD's 20-day bandwidth averaged 2.60% over the period, with a low of 0.67% and a high of 12.68%.

MeasureAll daysSqueeze daysFirst day of each squeeze
Observations2,30127537
Average absolute 20-day move1.36%1.46%1.45%
Median absolute 20-day move1.14%1.18%1.16%
Band break within 10 days, same direction 20 days laterNot measuredNot measured16 of 30 (53%)

What settings do people use?

The default of 20 periods and 2 standard deviations is Bollinger's own and is the starting point on nearly every platform. Shorter windows make the bands react faster and touch more often; longer windows smooth them. A wider multiple makes band touches rarer. We did not confirm any official recommendation for other settings, so changes are a matter of testing on the instrument and timeframe you trade.

One caution: a close outside a band is not a sell or buy signal on its own. In a strong trend, prices can stay near the upper or lower band for many bars. In the hypothetical uptrend above, percent b is 0.92 on the last bar, close to the upper band, while the trend is still rising. Treat band touches as information about volatility, and pair them with a rule about direction and risk that you have tested.

How can you use the bands in a trade plan?

A practical use is position sizing, not entry timing. Wide bands mean big recent swings, so a stop sized to the bands is farther away and the position should be smaller. In the uptrend example the band half-width is 2 x 1.2409 = 2.48 points. If you risk C$100 per trade on a stock that moves in those units, a stop 2.48 points away means 100 / 2.48 = 40.3, or 40 shares. In the flat series the half-width is 0.18, so the same C$100 risk allows 555 shares, which shows how much the band width alone changes size.

Those numbers are hypothetical and ignore commissions and gaps. A stop set to a band is only as reliable as the volatility estimate behind it, and volatility changes.

Limits of Bollinger Bands and who should not rely on them

The bands lag: they are built from the past 20 bars and cannot anticipate news. Price outside the band is common in trends, so a mean reversion rule that sells every upper-band touch will lose in a persistent rise. The squeeze flags a volatility change, but our test shows the extra move after one is small on a currency pair and gives no usable direction.

Our test has limits. It uses one instrument, daily averages instead of closes, and a squeeze definition we chose. A stock, a futures contract or a different timeframe could behave differently. We did not confirm peer-reviewed studies on Bollinger Bands, so we make no claim beyond our own sample. Do not use this page as a reason to trade a squeeze: prop firm evaluations use simulated capital with strict drawdown limits, and a volatility burst can breach them quickly. This is education, not advice.

Frequently asked questions

What are the default Bollinger Band settings?

A 20-period simple moving average with bands two standard deviations above and below, per John Bollinger's own site, which also says it uses the population standard deviation.

How do you calculate Bollinger Bands?

Take the 20-bar average of closes as the middle band, compute the population standard deviation of the same 20 closes, and add and subtract 2 times it. In our hypothetical series that gives 54.89 and 49.93 around 52.41.

What is a Bollinger Band squeeze?

A period when bandwidth is unusually low versus its own history, suggesting volatility may rise. There is no official threshold; we used the lowest 10% of the last 126 days.

Is the Bollinger squeeze a reliable signal?

In our test on 2,466 daily USD/CAD rates it was not: the average 20-day absolute move was 1.46% after a squeeze against 1.36% on all days, and the direction after a band break was right 16 times in 30. One instrument, one definition.

Should I buy when price touches the lower band?

Not on that alone. In a downtrend prices can stay at the lower band for many bars. The band shows volatility, not direction.

Sources

Provider documents behind this page, checked November 23, 2026.