Bollinger Bands (BB)

Bollinger Bands
Indicator

VolatilityOn the price chartFree on ChartLabs

Bollinger Bands wrap price in a channel two standard deviations either side of a 20-bar average. They widen when price swings hard and pinch when it goes quiet.

Created by John Bollinger in the early 1980s. Reviewed by the ChartLabs team, updated Nov 2026.

Example market1hIndicatorsAtlas AIBollinger Bandschartlabs.co/charts
Atlas reads it

Price is in the lower half of the bands, under the 20 SMA basis.

Upper 71,010 · Basis 67,669 · Lower 64,327

Atlas reads it

Price is in the lower half of the bands, under the 20 SMA basis.

Upper 71,010 · Basis 67,669 · Lower 64,327

Illustration on simulated data.

Bollinger Bands (BB)What is the Bollinger Bands indicator?

Bollinger Bands draw three lines on the price chart. The blue basis in the middle is a 20-bar simple moving average of the close. The red upper band and the green lower band sit two standard deviations above and below it, with a light blue fill between them.

Standard deviation measures how far closes have strayed from their average. When the last 20 closes are spread out, the bands move apart. When they bunch together, the bands squeeze in. The channel is always built from the market's own recent behaviour, so it fits a quiet stock and a fast coin alike.

A close outside a band is not a signal on its own. It says price moved further than usual compared with the last 20 bars. In a strong trend price can ride one band for a long time, while in a range it tends to swing from one band back toward the basis.

The squeeze

When the bands are the narrowest they have been in a while, volatility is low. Quiet spells tend to end with a larger move, but the squeeze does not say which way.

Bands, BandWidth and %B

BandWidth measures the gap between the bands as a share of the basis. %B shows where the close sits inside the bands, 0 at the lower band and 1 at the upper. Both are separate indicators on ChartLabs.

Bollinger Bands signalsFive patterns to know.

Narrowest bands in view
1Inconclusive

The squeeze

The bands pinch to their narrowest in a while. Volatility is low and a bigger move is often building, direction unknown.

2Inconclusive

Expansion after a squeeze

Price closes outside a band as the bands start to widen. The first strong close often hints at the direction of the next leg.

3Bullish

Walking the upper band

Closes keep landing near or above the upper band while the basis rises. That is a strong uptrend, not an automatic top.

4Bearish

Walking the lower band

Closes hug the lower band while the basis falls. Sellers are in control and bounces stay short.

5Bullish lean

Pullback to the basis

In an uptrend, dips that stop near the middle band and close back above it show buyers are still active.

Bollinger Bands formulaHow it is calculated.

Basis=SMA20(close)σ=120∑i=120(closei−Basis)2Upper=Basis+2σLower=Basis−2σ
STEP 1

Average the closes

Take the simple average of the last 20 closes. That is the basis, the blue middle line.

STEP 2

Measure the spread

Work out the standard deviation of the same 20 closes. ChartLabs uses the population form, dividing by 20, as TradingView does.

STEP 3

Add and subtract

Add two standard deviations to the basis for the upper band and subtract two for the lower band.

Bollinger Bands settingsEvery setting, explained.

SettingDefaultRangeWhat it changes
Length201 to 5,000 (typical 10 to 50)How many bars feed the average and the standard deviation. Shorter bands hug price more tightly.
Basis MA TypeSMASMA, EMA, SMMA (RMA), WMA, VWMAThe average used for the middle line. The width still comes from the standard deviation of the source.
SourceCloseAny price, or volumeWhich values feed the calculation.
StdDev20 to 50How many standard deviations the bands sit from the basis. 2.5 or 3 gives wider bands that price touches less often.
Offset0-500 to 500Shifts all three lines left or right by that many bars. The values do not change.
Lines and fillUpper red #F23645, basis blue #2962FF, lower green #089981, 1 px; fill light blueAny colour and widthThe look of each line and the fill between the bands.
Setting
Length
Default
20
Range
1 to 5,000 (typical 10 to 50)
What it changes
How many bars feed the average and the standard deviation. Shorter bands hug price more tightly.
Setting
Basis MA Type
Default
SMA
Range
SMA, EMA, SMMA (RMA), WMA, VWMA
What it changes
The average used for the middle line. The width still comes from the standard deviation of the source.
Setting
Source
Default
Close
Range
Any price, or volume
What it changes
Which values feed the calculation.
Setting
StdDev
Default
2
Range
0 to 50
What it changes
How many standard deviations the bands sit from the basis. 2.5 or 3 gives wider bands that price touches less often.
Setting
Offset
Default
0
Range
-500 to 500
What it changes
Shifts all three lines left or right by that many bars. The values do not change.
Setting
Lines and fill
Default
Upper red #F23645, basis blue #2962FF, lower green #089981, 1 px; fill light blue
Range
Any colour and width
What it changes
The look of each line and the fill between the bands.
208 closes outside the bands
70,77367,21263,65160,09064,803.7

Drag to see how the setting changes the lines and how many signals you get. Illustration on simulated data.

Bollinger Bands strategiesUse it in 3 setups.

Squeeze, then the first close outside

IfBandWidthis at a lowandprice closes outside a bandthenfollow that side

Traders often wait for a full close outside the band after a squeeze, rather than guessing the direction while the bands are still tight.

Buy the dip to the basis in a trend

Whilebasisis risingifprice dips to it and closes above

In an uptrend the middle band often acts as a pullback area. Many traders want a close back above it before acting.

Close back inside the band

Ifprice closes under the lower bandthenback insidetargetbasis

In a range, a close back inside the band after a stretch is a common mean reversion trigger. In a trend it fails more often.

Test a rule in the Strategy TesterFree with 1 year of history. Past results do not guarantee future results.

Bollinger Bands mistakesCommon mistakes.

Selling every touch of the upper band

In a strong uptrend price can close at or above the upper band again and again. A touch only says the move is large compared with the last 20 bars.

Narrowest bands in view

Guessing the squeeze direction

A squeeze says a move may be coming, not which way. Many traders wait for price to break out before taking a side.

Treating the lower band as a floor

The bands move with price. In a sell-off the lower band keeps falling, so buying each touch can mean buying all the way down.

Bollinger Bands combinationsPair it with these.

Bollinger Bands FAQQuestions traders ask.

What are the best Bollinger Bands settings?

20 bars and 2 standard deviations is the default on ChartLabs and the setting John Bollinger published. Bollinger suggested about 1.9 deviations for a 10-bar length and 2.1 for 50 bars.

What does a Bollinger Band squeeze mean?

The bands are the narrowest they have been in a while, so volatility is low. Quiet periods often end with a bigger move, but the squeeze does not tell you the direction.

Is price outside the bands a sell or buy signal?

Not by itself. A close outside a band means the move was large compared with the last 20 bars. Trends can keep closing outside a band for some time.

What is the middle Bollinger Band?

It is a 20-bar simple moving average of the close by default. You can switch it to an EMA, SMMA, WMA or VWMA in the settings.

How much of price stays inside the bands?

Most closes land inside two standard deviations, but market prices are not normally distributed, so outside closes happen more often than textbook statistics suggest.

Bollinger Bands or Keltner Channel?

Bollinger Bands use standard deviation of closes, so they react sharply to big moves. Keltner Channels use average true range and move more smoothly. Many traders use both together for the squeeze.

Do Bollinger Bands work on crypto?

Yes. They adapt to each market's own volatility, so they fit fast coins as well as slower stocks. Crypto trends can walk a band for a long time.

Why are my bands different from TradingView?

Usually the length, source, deviation or basis type differs, or a different amount of history is loaded. ChartLabs uses the population standard deviation, the same as TradingView.

Do Bollinger Bands repaint?

No. Values on closed bars never change. The live bar moves until it closes.

Who created Bollinger Bands?

John Bollinger developed them in the early 1980s and described them in detail in Bollinger on Bollinger Bands, published in 2001.

Related indicatorsMore volatility tools.

All volatility indicators

Try Bollinger Bands on a live chart.
Free. No download.

Works in your browser and on iPhone too.

Example market1h
BB (20, SMA, close, 2)