Free trial
Menu
Learn guide

Bollinger Bands: How the Bands, %B and Bandwidth Work

Bollinger Bands are three lines drawn around the price: a 20-period simple moving average in the middle, and an upper and a lower band two standard deviations above and below it. John Bollinger developed them in the 1980s. Because the standard deviation rises when prices swing more and falls when they settle, the bands widen in volatile markets and narrow in quiet ones, so they show both where the price sits against its recent average and how volatile the market has been.

QuantPower Research · Updated 6 Nov 2026 · 17 min read

This guide calculates the bands on a model Nifty series, explains %B and bandwidth, the squeeze, closes outside the bands and walks along them, the settings traders use, and where the bands mislead.

Key point
A close outside a band is information, not a signal. On the model series below, Nifty closed above the upper band five sessions in a row during the rally and kept rising, and closed below the lower band on the two sessions before the low.

Key takeaways

  • Middle band = 20-period SMA. Upper band = middle + 2 standard deviations. Lower band = middle − 2 standard deviations.
  • %B places the close within the bands: 1 is the upper band, 0 the lower band, 0.5 the middle. Readings above 1 or below 0 mean the close is outside.
  • Bandwidth is the distance between the bands as a share of the middle band. On the model series it ranged from 2.02% to 7.92%.
  • A squeeze, the narrowest bandwidth in a long while, shows unusually low volatility. It does not show the direction of the next move.
  • In a strong trend the price can walk along a band for many sessions. Mean-reversion rules need a filter for those periods.
  • Read the bands on the index or futures chart. On an option's own chart, time decay pulls the price down through the bands.

The model Nifty series

Every number on this page comes from one model series of 72 daily closes, a seeded random walk that is not market data. It is the same series used in the guides to RSI, moving averages and MACD.

PhaseSessionsClose at the startClose at the end
Dip and slow riseDays 1 to 2524,800.0024,920.15
Rally to the highDays 26 to 3224,959.4525,500.00
Fall to the lowDays 33 to 4425,473.0024,158.55
RecoveryDays 45 to 7224,181.2025,867.60

The bands need 20 closes, so they start on day 20.

Bollinger Bands formula

Formula
Middle band = SMA of the last 20 closes. Upper band = middle band + 2 × standard deviation of the last 20 closes. Lower band = middle band − 2 × standard deviation.

The standard deviation measures how far the 20 closes sit from their average. Bollinger uses the population standard deviation, dividing by 20 rather than 19, and most charting platforms follow him.

  1. Average the last 20 closes. That is the middle band.
  2. Measure the spread. Subtract the average from each close, square the differences, average the squares and take the square root.
  3. Add and subtract twice the spread. That gives the upper and lower bands.
Example
On day 44, the low of the model series, the 20-day SMA is 24,975.57 and the standard deviation of the last 20 closes is 402.69 points. The upper band is 24,975.57 + 2 × 402.69 = 25,780.96 and the lower band 24,975.57 − 805.39 = 24,170.18. Nifty closes at 24,158.55, 11.63 points below the lower band.

Compare day 21, when the market had been quiet for weeks. The middle band is 24,710.47 and the standard deviation only 124.70 points, so the bands sit at 24,959.87 and 24,461.08, less than 500 points apart. On day 44 they were 1,610.78 points apart.

The standard deviation, step by step

The 20 closes behind the day 44 bands run from day 25 to day 44. Their average is 24,975.57, the middle band.

DayCloseDistance from the averageDistance squared
2524,920.15−55.423,071
2624,959.45−16.12260
2725,044.50+68.934,752
2825,120.20+144.6320,919
2925,285.60+310.0396,120
3025,401.25+425.681,81,206
3125,471.05+495.482,45,503
3225,500.00+524.432,75,029
3325,473.00+497.432,47,439
3425,432.65+457.082,08,924
3525,285.10+309.5395,810
3625,137.40+161.8326,190
3724,938.05−37.521,408
3824,723.15−252.4263,715
3924,761.10−214.4745,996
4024,622.45−353.121,24,692
4124,483.65−491.922,41,983
4224,504.95−470.622,21,481
4324,289.10−686.474,71,238
4424,158.55−817.026,67,518
Total32,43,252

The squared distances add up to 32,43,252. Divided by 20 that gives a variance of 1,62,162.61, and its square root is the standard deviation, 402.69 points.

The table shows what the bands actually measure. Most of the 402.69 comes from the swing inside the window, from the rally's high near 25,500 to the fall's low near 24,160, not from day-to-day noise: the average daily change over the same 20 sessions was only 105.68 points. Bollinger Bands measure how spread out the recent closes are, and a trend inside the window counts as spread just as much as choppy trading does.

Percent B indicator (%B)

Formula
%B = (close − lower band) ÷ (upper band − lower band)

%B turns the close's position within the bands into a single number:

%BWhere the close is
Above 1Above the upper band
1On the upper band
0.5On the middle band
0On the lower band
Below 0Below the lower band

On day 44 %B is (24,158.55 − 24,170.18) ÷ 1,610.78 = −0.007, just below the lower band. On day 32, the high, it is 1.026, just above the upper band. Because %B is a ratio, it can be compared across instruments and used in rules the way RSI is: a rule might buy only when %B is below 0.2 in an uptrend, or exit when it rises above 0.8.

Bollinger bandwidth

Formula
Bandwidth = (upper band − lower band) ÷ middle band × 100

Bandwidth measures how wide the bands are in percent of the price. It equals four standard deviations divided by the average, so it is a measure of recent volatility in price levels.

On the model series bandwidth was narrowest on day 21, at 2.02%, while Nifty drifted near 24,800. It widened to 4.27% at the top of the rally on day 34 and to 7.92% on day 49, after the fall, almost four times its narrowest reading. By day 70 the recovery had steadied and it was back to 3.75%.

Bandwidth looks back over 20 closes, so it peaks after the move that caused it. On the model series the widest bands came on day 49, five sessions after the low, when the fall was already over.

Reading the bands on the model series

Bollinger Bands on the model Nifty series: a squeeze before the rally and closes outside the bands at both extremes
DayCloseUpper bandLower band%BBandwidthWhat happened
2124,796.0524,959.8724,461.080.6722.02%Narrowest bands: the squeeze
2825,120.2025,103.1024,516.571.0292.36%First close above the upper band
3225,500.0025,473.8524,459.681.0264.06%Price high, the fifth close in a row above the band
3325,473.0025,537.2424,480.040.9394.23%Back inside the bands
3724,938.0525,596.3924,595.390.3423.99%Close below the middle band
4324,289.1025,726.7224,293.18−0.0035.73%First close below the lower band
4424,158.5525,780.9624,170.18−0.0076.45%Price low
4524,181.2025,815.4224,061.820.0687.03%Back inside the bands
4924,332.4525,758.2423,797.050.2737.92%Widest bands
5224,799.0525,457.6523,853.750.5896.51%Close above the middle band
7025,569.7025,588.9524,647.100.9803.75%Bands narrow again
7225,867.6025,771.1424,682.971.0894.31%Second close in a row above the upper band

Four behaviours show in the table: a quiet market with narrow bands, a breakout that walked along the upper band, a fall that pushed the close below the lower band just before the low, and bands that were widest after the move rather than during it.

%B and bandwidth through the series

Phase%BBandwidthWhat the bands said
Days 20 to 27Between 0.66 and 0.952.02% to 2.39%A quiet market drifting up inside narrow bands
Days 28 to 32Above 1 every session2.36% to 4.06%A breakout walking along the upper band
Days 33 to 44Falling from 0.94 to −0.0073.99% to 6.45%A fall from the upper band to below the lower one
Days 45 to 52Rising from 0.07 to 0.59Peaking at 7.92% on day 49The low behind, the bands at their widest
Days 53 to 72Between 0.69 and 1.09Narrowing to 3.75% on day 70, then 4.31%A steady recovery, back at the upper band by the end

The two measures answer different questions. %B tracked the direction of the moves: high in the rally, negative at the low, high again in the recovery. Bandwidth tracked how violent they had been and lagged them, staying wide long after the fall had ended.

How the bands react to single days

Because the bands are built from a 20-close window, a single large close moves them twice: once when it enters the window and again, 20 sessions later, when it leaves.

DayChange in the closeStandard deviationBandwidth
28 to 29+165.40146.63 to 167.162.36% to 2.69%
42 to 43−215.85320.74 to 358.395.12% to 5.73%
49 to 56The rally's closes leave the window490.30 to 264.647.92% to 4.31%

The first two rows show the bands widening on the day of a large move. The third shows the reverse: between day 49 and day 56 the closes from days 30 to 36, the top of the rally, dropped out of the window one by one, and bandwidth almost halved while the index was rising steadily. A sudden narrowing of the bands can come from old moves leaving the window as much as from the market becoming quiet.

The squeeze

A squeeze is a period when bandwidth falls to its lowest level in a long while. Volatility tends to come in cycles: quiet periods are often followed by active ones, and the squeeze marks the quiet part.

On the model series the narrowest bands came on days 20 and 21, at 2.02%, and bandwidth stayed below 2.40% through day 28. That day Nifty closed above the upper band at 25,120.20, and four sessions later it reached 25,500.00, 379.80 points higher.

A squeeze says that volatility is low, not which way the next move will go. The model breakout happened to be upward; a squeeze can just as easily end with a close below the lower band. Breakout rules usually wait for the first close outside a band after the squeeze, and many add a volume or trend condition. The rules, model trades and exits are set out in the Bollinger Band breakout strategy.

Closes outside the bands

If prices followed a normal distribution, about 95% of closes would fall inside two standard deviations of the average. Prices do not: they trend and they have fat tails, and the bands are built from the last 20 closes, which move with the trend. On the model series 9 of the 53 closes from day 20, about 17%, fell outside the bands, mostly during the two strongest moves.

Closes outsideDaysContext
Above the upper band28 to 32The rally out of the squeeze
Below the lower band43 and 44The last two sessions of the fall
Above the upper band71 and 72The end of the recovery

A close outside a band says the move was large for the recent volatility. In a range it often comes near a turn; in a trend it often comes in the middle of the move.

Walking the band

In a strong trend the price can close at or beyond a band again and again, with %B staying near or above 1 in an uptrend or near or below 0 in a downtrend. This is called walking the band. From day 28 to day 32 the model series closed above the upper band five sessions in a row while Nifty rose another 379.80 points. A rule that sold every close above the upper band would have sold on each of those days.

Bollinger himself has written that a touch of a band is not a signal on its own. What a touch means depends on the trend: in a range it is a stretch to fade, in a trend it is a sign of strength.

Mean reversion with the bands

Mean-reversion rules treat the bands as the edges of normal movement and trade the move back to the middle. A common version waits for a close back inside the band rather than buying the first close outside it.

On the model series the close fell below the lower band on day 43 and again on day 44, the low, and closed back inside on day 45 at 24,181.20, with the middle band at 24,938.62. The first close above the middle band came on day 52, at 24,799.05; by then the middle band itself had fallen to 24,655.70, because it is an average of the falling prices. A target set at the middle band moves while the trade is open.

These rules lose when a fall continues: a close back inside the band can be followed by another close outside it. They usually need a trend or range filter and a stop beyond the recent extreme. Full rule sets and model trades are in the Bollinger Band mean reversion strategy.

Two opposite uses of the same bands

Mean reversionBreakout
The viewPrices outside the bands are stretched and come backA close outside the bands after a squeeze starts a move
Typical entryClose back inside a bandFirst close outside a band after a squeeze
TargetThe middle bandA trailing stop or a multiple of the risk
Works inRangesTrends
Fails inTrends, when the price walks the bandRanges, when the breakout reverses

The same close outside a band is a sell to one rule and a buy to the other, so the market condition matters more than the band touch. A trend filter, such as the slope of a longer moving average or ADX, helps decide which rule applies.

Bollinger's rules of thumb

John Bollinger's book sets out a number of principles for using the bands. In summary:

  • The bands define high and low in relative terms. A price at the upper band is high compared with the recent past, not high in any absolute sense.
  • Touches are not signals. A close at or beyond a band describes the move; what to do about it depends on the trend and on other evidence.
  • Combine the bands with indicators that measure something else. Momentum or volume indicators add information; indicators built from the same closes, such as a second moving average, mostly repeat it.
  • Use %B and bandwidth. They turn the bands into numbers that can be compared over time and used in rules.
  • Look for patterns relative to the bands. A W-bottom is a low outside or at the lower band followed by a second low that holds inside it; an M-top is the mirror image. The second extreme holding inside the band shows weaker momentum.
  • Breakouts after a squeeze have no built-in direction. Many squeezes start with a false move the other way, sometimes called a head fake.
  • Settings are a starting point. The 20-period, 2-standard-deviation default suits most markets; adjust the multiplier slightly if the period changes.

Settings

SettingUse
20 periods, 2 standard deviationsThe standard, on daily and intraday charts
10 periods, 1.9 standard deviationsShorter-term trading; Bollinger suggested narrowing the bands slightly for shorter periods
50 periods, 2.1 standard deviationsLonger trends; slightly wider bands for longer periods
20 periods, 1 standard deviationAn inner band, used with the standard bands to mark strong trend zones

Shorter periods make the bands follow the price more closely and put more closes outside them. More standard deviations put fewer closes outside. As with any indicator, a setting fitted to past signals rarely holds on new data, so choose one, test it with costs over several years and keep it.

Bollinger Bands on intraday charts

The NSE equity and F&O session runs from 9:15 am to 3:30 pm. A 20-period band covers 100 minutes on a 5-minute chart and 5 hours on a 15-minute chart, most of one session.

  • The opening gap. A gap at 9:15 am moves the close far from the average and adds to the standard deviation, so the bands widen sharply in the first candles.
  • The lunchtime lull. Bandwidth often narrows in the quieter middle of the session, which can look like a squeeze without the meaning of a multi-week one.
  • Continuity across sessions. Platforms carry the calculation across sessions, so the morning's bands include the previous afternoon.

A common way to use the bands on two timeframes is to read the daily bands for context and the intraday bands for timing. A daily close near the lower band in an uptrend marks a pullback; a 15-minute close back inside its own lower band can then be the entry, with a stop below the intraday low. The slower bands decide which kind of trade to look for, and the faster ones decide when.

Bollinger Bands on Nifty, Bank Nifty and stocks

%B and bandwidth are ratios, so unlike the bands themselves they can be compared across instruments. Bank Nifty usually moves more than Nifty in percentage terms, so its bandwidth tends to run wider, and a squeeze on Bank Nifty is judged against Bank Nifty's own history, not against Nifty's. Stocks widen their bands sharply around results, and a stock's bandwidth on the day after results says more about that event than about the trend.

Two data points matter. A continuous futures chart jumps at each monthly roll unless the data is adjusted, and the jump enters the standard deviation as if it were a real move. Splits and bonus issues change a stock's price without changing its value, so the bands need adjusted prices or they will show a collapse that never happened.

Bollinger Bands, volatility and options

Bandwidth reflects how much the price has moved over the last 20 periods, a form of realised volatility. Option premiums depend on implied volatility, the market's expectation of future movement, which India VIX measures for Nifty. The two often move together, but not always: implied volatility usually rises before scheduled events while bandwidth is still narrow, and falls after them even as bandwidth widens from the move.

Option traders use the bands in a few ways:

  • On the underlying. Read the bands on Nifty or Bank Nifty, or on futures, and trade options on that view. On an option's own chart, time decay drags the price down through the bands.
  • As a volatility context. A squeeze on the index alongside low implied volatility can make bought options cheaper relative to the move that might follow; wide bands after a large move alongside high implied volatility can favour sellers once the move settles. Neither is a forecast.
  • For strike distance. The distance from the price to the bands gives a recent-volatility reference for how far an index has been moving, which some sellers compare with their strike distance.

Keltner Channels and other envelopes

EnvelopeMiddle lineBand distanceCharacter
Bollinger Bands20-period SMA2 standard deviations of closesWidens sharply after large moves
Keltner Channels20-period EMAA multiple of the average true rangeSmoother; widens more slowly
Percentage envelopeA moving averageA fixed percentageSame width in all conditions
Donchian channelNoneHighest high and lowest low of N periodsPrice-action levels, no average

When Bollinger Bands move inside Keltner Channels, standard deviation has fallen faster than the average range, which some traders use as their definition of a squeeze.

The limits of Bollinger Bands

  • They lag. The middle band is a 20-period average and the bands are built from the last 20 closes. Bandwidth peaked five sessions after the model low.
  • They do not show direction. A squeeze shows low volatility, not which way the next move will go.
  • Closes outside are common in trends. About 17% of the model closes were outside the bands.
  • They use only closes. Highs, lows, gaps within a candle and volume do not enter the calculation.
  • They are not a forecast. The bands describe recent prices and their spread.

Common mistakes

  • Selling every touch of the upper band. In a trend the price walks the band.
  • Buying the first close below the lower band. Waiting for a close back inside, and a stop, avoids buying in the middle of a fall.
  • Treating the middle band as a fixed target. It moves with the price while the trade is open.
  • Reading a squeeze as a direction. It only says volatility is low.
  • Changing the settings to fit recent trades. The standard (20, 2) is a reasonable default for most instruments.
  • Reading the bands on an option's chart. Use the underlying.

Using Bollinger Bands in QuantPower

In the option strategy builder, Bollinger Band conditions on the underlying can be part of indicator-based entries and exits, together with price levels, moving averages and time windows. The trade can be an option, a spread or a futures position. Test the rules in backtesting on five years of 1-minute data, then run them on live prices in paper trading before deploying them through your broker.

Start your free trial

Connect your broker, build a strategy and test it on paper before a single live order goes out.

Frequently asked questions

How are Bollinger Bands calculated?

Take the 20-period simple moving average as the middle band. Calculate the standard deviation of the same 20 closes, and draw the upper and lower bands two standard deviations above and below the middle band.

What are the best Bollinger Band settings?

20 periods and 2 standard deviations are the standard and a sensible starting point for most charts. Bollinger suggested 1.9 standard deviations with 10 periods and 2.1 with 50 periods to keep a similar share of closes inside the bands.

What does %B mean?

Where the close sits within the bands: 1 at the upper band, 0 at the lower band and 0.5 at the middle. Values above 1 or below 0 mean the close is outside the bands.

What does bandwidth show?

How far apart the bands are as a percentage of the middle band. Low bandwidth means the market has been quiet; high bandwidth means it has been volatile.

Why do the bands widen after a big move?

The bands are built from the standard deviation of the last 20 closes, and a large move raises it. Because the calculation looks back 20 periods, the bands keep widening for a while after the move and narrow only as the large changes leave the window.

Do Bollinger Bands work on intraday charts?

The calculation is the same on any timeframe. On a 5-minute chart the standard bands cover 100 minutes of trading, and the opening gap and the quieter middle of the session both affect them, so many intraday traders use the daily bands for context and the intraday bands only for timing.

How are Bollinger Bands different from Keltner Channels?

Bollinger Bands use the standard deviation of closes around a simple moving average. Keltner Channels use a multiple of the average true range around an exponential moving average, which makes them smoother and slower to widen.

Sources

  • Bollinger, J. (2001). Bollinger on Bollinger Bands. McGraw-Hill
  • Keltner, C. W. (1960). How to Make Money in Commodities. The Keltner Statistical Service
  • NSE: trading hours for the equity and equity derivatives segments
Figures and charts on this page use a model Nifty series, not market data. Trading involves substantial risk, and this guide is for education, not investment advice.