Bollinger Bands Calculator
Bollinger Bands calculator with the full formula, a 20-close worked example, %B, bandwidth and Nifty settings. You enter the average and deviation yourself.
This Bollinger Bands calculator uses an average and standard deviation you already have to calculate the upper, middle and lower bands, plus the current price’s position within them. It does not calculate those inputs from a price history. Its Bandwidth % card has an incorrect label: it shows the price gap between the bands with a percent sign. Use the percentage formula below to check width.
Bring the average and deviation from the same chart
The form asks for 20-Period SMA, Standard Deviation, Band Multiplier and Current Price. SMA means simple moving average: the average of the selected observations. Standard deviation measures how spread out those observations are. A multiplier is a separate number that scales the deviation.
The usual starting convention is a 20-period average and a multiplier of 2, as described in John Bollinger’s rules. A period is a chart bar, so it need not mean a trading day. The form’s average label is fixed; there is no separate period selector or list of closing prices here.
- Use the same instrument, timeframe and completed chart bar for the average and deviation.
- Keep the price units consistent. An index average and an option-premium deviation do not describe the same series.
- Enter the deviation as a price amount, rather than entering the multiplier again.
- Record the price timestamp beside your notes if you are comparing results later.
For a broader explanation of what the indicator measures, read how to use Bollinger Bands. The calculator checks a supplied snapshot; your charting source remains responsible for the rolling inputs.
Calculate the band levels
- Middle band = the SMA you enter.
- Upper band = SMA + standard deviation × multiplier.
- Lower band = SMA − standard deviation × multiplier.
Increasing only the multiplier widens both outer bands equally around the same middle. Changing Current Price alone changes its position within the bands, while the band levels stay unchanged. To measure a later bar, obtain the later average and deviation as well.
This distinction matters when comparing screenshots. A price can rise while its position within newly calculated bands falls, because the average and deviation have also moved. Keep each price with its own matching band inputs instead of reusing an earlier snapshot.
Bollinger Bands Calculation Step by Step
The calculator above needs an average and a standard deviation as inputs. This section shows where those two numbers come from, using 20 made-up closing prices. They are an example and not the prices of any real instrument.
- Write down the last 20 closing prices (20 bars of the timeframe you use).
- Add them up and divide by 20. That is the 20-period simple moving average, which is the middle band.
- Subtract the average from each close, then square each answer. Squaring removes minus signs and gives bigger moves more weight.
- Add the squared answers and divide by 20. That is the variance. Its square root is the standard deviation.
- Upper band = average + 2 x standard deviation. Lower band = average - 2 x standard deviation.
| Bar | Close (made-up) | Close minus average (109) | Squared |
|---|---|---|---|
| 1 | 100 | -9 | 81 |
| 2 | 102 | -7 | 49 |
| 3 | 101 | -8 | 64 |
| 4 | 103 | -6 | 36 |
| 5 | 105 | -4 | 16 |
| 6 | 104 | -5 | 25 |
| 7 | 106 | -3 | 9 |
| 8 | 108 | -1 | 1 |
| 9 | 107 | -2 | 4 |
| 10 | 109 | 0 | 0 |
| 11 | 110 | 1 | 1 |
| 12 | 108 | -1 | 1 |
| 13 | 111 | 2 | 4 |
| 14 | 113 | 4 | 16 |
| 15 | 112 | 3 | 9 |
| 16 | 114 | 5 | 25 |
| 17 | 116 | 7 | 49 |
| 18 | 115 | 6 | 36 |
| 19 | 117 | 8 | 64 |
| 20 | 119 | 10 | 100 |
The average is 2,180 / 20 = 109. The squared answers add up to 590. Divided by 20 that is 29.5, and the square root of 29.5 is about 5.43. Two standard deviations is about 10.86. So the middle band is 109, the upper band is about 119.86 and the lower band is about 98.14. Type 109 as the SMA, 5.43 as the Standard Deviation, 2 as the Band Multiplier and 119 (the last close) as the Current Price into the calculator above to get the same bands.
The Other Two Numbers: %B and BandWidth
- %B = (price - lower band) / (upper band - lower band). With a last close of 119 the answer is about 0.96, or 96.03% on the percentage scale this calculator uses. The price is close to the upper band.
- BandWidth = (upper band - lower band) / middle band. Here it is about 21.73 / 109 = 19.93%. A narrow reading means the closes have been bunched together and a wide reading means they have been spread out.
Worked example: levels, position and true bandwidth
Illustrative example only: enter SMA ₹5,000, Standard Deviation ₹100, Band Multiplier 2 and Current Price ₹5,100. These invented inputs demonstrate the calculation; they are not current prices for a security.
| Measure | Arithmetic | Result |
|---|---|---|
| Middle band | Entered average | ₹5,000 |
| Upper band | 5,000 + 100 × 2 | ₹5,200 |
| Lower band | 5,000 − 100 × 2 | ₹4,800 |
| Raw band width | 5,200 − 4,800 | 400 price points |
| True bandwidth percentage | 400 ÷ 5,000 × 100 | 8% |
| %B as shown by this tool | (5,100 − 4,800) ÷ 400 × 100 | 75% |
The band cards agree with the example’s levels. The Bandwidth % card displays 400% because it attaches a percent sign to raw width. That is a display error, not a measurement of percentage volatility. The independently calculated bandwidth is 8%.
For %B, this page uses a percentage scale. The example’s 75% corresponds to 0.75 on a decimal scale. The lower band is 0%, the middle is 50% and the upper band is 100%. Values outside that interval show a price outside the bands; they are possible and do not need to be forced back inside.
Population vs Sample Standard Deviation: Why Charts Differ
There are two ways to work out standard deviation. The population version divides the squared answers by the number of bars (20). The sample version divides by one less (19). Most charting platforms use the population version, according to a LuxAlgo explainer, but check the help page of your own platform.
With the 20 made-up closes above, the sample version gives a standard deviation of about 5.57 instead of 5.43. The bands then land at about 120.14 and 97.86 instead of 119.86 and 98.14. That is a small gap, but enough to explain why your number is a few points off a chart.
Other common reasons for a difference:
- The chart uses an exponential or weighted average and not a simple one. John Bollinger's own rules say the traditional bands use a simple moving average.
- You used a different price (for example the typical price, which is high, low and close averaged) and not the close.
- The last bar is still forming, so its close keeps changing.
- Your data feed or the chart has a different start time for the bars, or adjusts for corporate actions.
- The chart uses a different period or multiplier from your sums.
Read band touches as observations
John Bollinger cautions that a band touch alone is not a trade signal and that trending prices can continue along a band. He also warns against treating band construction as a normal-distribution probability guarantee. A low relative price can keep falling; a high relative price can keep rising.
Write down what happened at the band and what your separate entry rule required. “Price touched the lower band” is an observation. “The trade must recover” is an expectation that the band calculation cannot establish. A stop, quantity and loss budget need their own reasoning.
The results show band levels, width and %B for the inputs you supply. They do not show how the bands changed across earlier bars or how a strategy performed.
Bollinger Band Settings for Nifty and Bank Nifty
The usual starting point is a 20-period average with a multiplier of 2. John Bollinger's published rules suggest a slightly lower multiplier (1.9) for a 10-period average and a slightly higher one (2.1) for a 50-period average. Some brokers' education pages suggest 1.5 for short-term and 2.5 for long-term settings, so published rules of thumb do not agree.
No setting has been shown to be best for the Nifty 50 or Bank Nifty. What helps is keeping everything consistent:
- Match the timeframe to how long you hold. A 5-minute chart gives many band touches that mean little for a swing trade. A daily chart gives fewer, slower readings.
- Use the same series you trade. Bands on the Nifty 50 index and bands on an option premium are different things. Premiums can jump with changes in volatility and time left, so their bands behave differently.
- Compare in percentages. Bank Nifty is quoted in larger points than the Nifty 50, so compare BandWidth % and %B and not raw points.
- Keep a note of the setting. If you change period or multiplier mid-way, you cannot compare older readings with newer ones.
The calculator labels its average as a 20-period SMA. If you prefer another period, take the average and deviation for that period from your chart and enter them; the labels will not change. The page how to use Bollinger Bands covers the indicator in more detail, and India VIX is a separate measure of expected volatility in the Nifty 50.
W-Bottoms, M-Tops and Walking the Bands
Bollinger describes a few shapes to watch. Treat each as an observation to note, not as an instruction.
- W-bottom: price makes a low at or below the lower band, bounces, then makes a second low that stays above the first and inside the band. It is meant to show that selling pressure is weaker the second time. It can still fail.
- M-top: the mirror image at the upper band: a high at or above the upper band, a dip, then a second high that stays below the first and inside the band.
- Walking the bands: in a strong trend, closes can hug the upper or lower band for many bars. A touch then shows strength and not an exhaustion signal, so a band touch alone does not mean price must turn.
Whatever you see, write down your exit before you enter: where the idea is wrong, how many lots and how much you are willing to lose. Use the risk-reward calculator for that. Mean-reversion ideas around the bands are discussed on our mean reversion strategy page.
A squeeze needs a comparison over time
A squeeze describes relatively narrow bands. A lone width reading does not tell you whether width is unusually low for that instrument and timeframe. Compare like-for-like historical readings on your chart, using the same settings and the correct percentage denominator.
This form cannot compare Bollinger Bands with Keltner Channels, another type of price envelope, or confirm a squeeze from historical widths. The separate Bollinger squeeze guide explains the setup’s context and limitations.
How to Spot a Bollinger Squeeze
A squeeze is a period when BandWidth is unusually low compared with its own recent history. A common test is whether BandWidth is near its lowest reading in about the last six months (about 125 daily bars). The test must use the same instrument, timeframe and settings throughout.
- Work out BandWidth for each of the last several months of bars on your chart.
- Find the lowest and highest readings in that window.
- Check where the latest reading sits. If it is at the bottom of the range, bands are squeezed.
- Note that a squeeze says volatility is low. It does not say which way price will go, or that a big move will follow.
The calculator above gives a single BandWidth snapshot, so it cannot do steps 1 to 3 for you. Our guide to the Bollinger squeeze explains the setup, and the standard deviation indicator page explains the building block.
Keep a usable record of each observation
- Save the average, deviation, multiplier, current price and timeframe together in your notes.
- State whether the price was a completed close or a changing quote.
- Write your independent entry and exit conditions before the result is known.
- When comparing with a chart, check its average type and deviation convention before assuming that a small difference is a calculator error.
You can log the resulting trade manually in OneTradeJournal, including strategy, stop, target, emotions and plan deviation. Use the risk-reward calculator for the planned price distances; Bollinger width does not determine the position’s acceptable loss.
Questions about calculating Bollinger Bands
Sources
- John Bollinger: Bollinger Bands rules, checked 15 Oct 2026.
- Current calculator and its input labels, checked 15 Oct 2026.
Related Topics
Related Articles
Absolute Returns Calculator: Total Gain or Loss
Absolute return calculator with formula, worked rupee examples and a comparison with CAGR and XIRR. Learn when absolute return misleads, such as for SIPs.
Options Rollover Calculator
Work out the debit or credit of rolling an option from premiums and lots. Learn roll up, down and out, charges, STT, and futures rollover cost and percentage.
Options Probability Calculator: Model Inputs and Limits
Estimate an option's expected move and price range from price, volatility and days to expiry, with a worked example and why the probability cards need care.
Trading Expectancy Calculator: Formula and Example
Trading expectancy calculator (EV per trade) from win rate, average win and average loss. See R-multiples, profit factor, sample size and low win-rate examples.
Trading Emotion Tracker: Review Feelings and Plan Discipline
Free trading emotion tracker. Log the mood, intensity and plan discipline behind a trade, get a simple rule-based score, and keep a record to review later.
MACD Calculator: Line, Signal and Histogram
Calculate the MACD line, signal line and histogram from your moving averages, with the formula, a worked example and how to read crossovers.
The trading journal for Nifty, Bank Nifty and Indian F&O. Track your trades, spot patterns, build discipline.
- Log one trade a day by hand, on purpose
- AI mentor finds your repeat mistakes
- Behavioural analytics catch tilt early
- Trading calendar with P&L heatmap
- Pre-trade checklist flags risks
Yearly ₹3,499 · No broker credentials