Bollinger Bands Calculator
Calculate bollinger bands with our free Bollinger bands Calculator. Compare rates, see projections, and make informed financial decisions.
Bollinger Bands Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: Upper Band = SMA(n) + k x StdDev(n); Lower Band = SMA(n) - k x StdDev(n)
Worked example — Upper: 46.6685 | SMA: 45.5500 | Lower: 44.4315 | %B: 92.47% (near overbought)
Formula
Upper Band = SMA(n) + k x StdDev(n); Lower Band = SMA(n) - k x StdDev(n)
Where SMA(n) is the simple moving average over n periods, StdDev(n) is the standard deviation over n periods, and k is the number of standard deviations (typically 2). Bandwidth = (Upper - Lower) / SMA x 100. %B = (Price - Lower) / (Upper - Lower) x 100.
Worked Examples
Example 1: Standard 20-Period Bollinger Bands Calculation
Problem:Calculate Bollinger Bands for a stock with 20 closing prices ranging from 44.50 to 46.50, using 2 standard deviations.
Solution:SMA(20) = Sum of 20 prices / 20 = 45.5500 Population SD = sqrt(sum of squared deviations / 20) = 0.5592 Upper Band = 45.5500 + 2 x 0.5592 = 46.6685 Lower Band = 45.5500 - 2 x 0.5592 = 44.4315 Bandwidth = (46.6685 - 44.4315) / 45.5500 x 100 = 4.91% %B = (46.50 - 44.4315) / (46.6685 - 44.4315) x 100 = 92.47%
Result:Upper: 46.6685 | SMA: 45.5500 | Lower: 44.4315 | %B: 92.47% (near overbought)
Example 2: Detecting a Bollinger Band Squeeze
Problem:A stock has Bollinger Bands with bandwidth of 2.1%. Is a squeeze occurring and what should a trader do?
Solution:Bandwidth = (Upper - Lower) / SMA x 100 = 2.1% Typical bandwidth ranges from 4% to 15% A bandwidth below 4% indicates a squeeze 2.1% is well below the 4% threshold Squeeze detected — expect a breakout Monitor volume and direction for the breakout move
Result:Squeeze confirmed at 2.1% bandwidth — prepare for a significant price breakout in either direction
Frequently Asked Questions
What are Bollinger Bands and how are they calculated?
Bollinger Bands are a technical analysis tool created by John Bollinger in the 1980s. They consist of three lines plotted on a price chart: a middle band which is a simple moving average (typically 20 periods), an upper band set at a specified number of standard deviations (typically 2) above the middle band, and a lower band set the same distance below. The standard deviation measures volatility, so the bands automatically widen during volatile markets and contract during calm markets. This adaptive behavior makes Bollinger Bands uniquely useful for gauging whether prices are relatively high or low on a statistical basis.
What does the %B indicator tell traders?
The %B indicator quantifies where the current price sits relative to the Bollinger Bands. It is calculated as (Price minus Lower Band) divided by (Upper Band minus Lower Band), then multiplied by 100 to express as a percentage. A %B value of 100 means price is exactly at the upper band, while 0 means it is at the lower band. Values above 100 indicate price is above the upper band (potential overbought condition), and values below 0 indicate price is below the lower band (potential oversold condition). Traders often use %B in combination with other indicators to identify high-probability trade setups and reversals.
What is a Bollinger Band squeeze and why does it matter?
A Bollinger Band squeeze occurs when the bandwidth (the distance between upper and lower bands relative to the middle band) narrows to unusually low levels. This contraction signals that market volatility has dropped significantly and often precedes a strong breakout move in either direction. Think of it like a coiled spring — the tighter the squeeze, the more explosive the potential breakout. Traders watch for squeezes to prepare for significant price movements, then use the direction of the subsequent breakout to determine their trading position. The squeeze concept is one of the most reliable patterns in technical analysis for anticipating large moves.
How should beginners use Bollinger Bands for trading decisions?
Beginners should start by understanding that Bollinger Bands are not standalone buy or sell signals. When price touches the upper band, it does not automatically mean sell, and touching the lower band does not automatically mean buy. Instead, use bands in context: in a strong uptrend, price riding the upper band is bullish, not overbought. Combine Bollinger Bands with volume analysis and momentum indicators like RSI for confirmation. A common beginner strategy is the double bottom pattern — when price drops below the lower band, rebounds, drops again but stays within the bands, then moves up. This pattern often signals a reliable buying opportunity when confirmed by volume.
What are the best settings for Bollinger Bands across different timeframes?
The default settings of 20-period SMA with 2 standard deviations work well for most applications, but adjustments can improve results for specific timeframes. John Bollinger's own published guidance is that the multiplier should move with the lookback, because a longer average is smoother and its bands must widen to keep roughly the same proportion of price inside them: he suggests about 1.9 standard deviations at a 10-period setting and about 2.1 at a 50-period setting, with the familiar 2.0 at 20. Note the direction of that rule — shortening the period calls for a slightly narrower band, not a wider one. Some traders also use a 21-period average to approximate a month of trading days. Whatever you choose, change one variable at a time and backtest on your own instrument before risking capital, since the right setting depends on how that market's volatility is distributed.
Which standard deviation formula do these bands use, population or sample?
This tool divides the summed squared deviations by n rather than by n minus 1, the population form that charting packages conventionally apply to Bollinger Bands. The reasoning is that the band describes the same closes it was built from rather than inferring a wider universe, so no degrees-of-freedom correction is applied. The practical gap is small: at a 20-period setting the sample version would be larger by the square root of 20/19, about 2.6 percent.
What is the difference between %B and bandwidth?
Both are derived from the same three lines but answer different questions. %B locates price inside the channel: 100 at the upper band, 0 at the lower band and 50 at the moving average, so it is a position measure. Bandwidth divides the distance between the outer bands by the middle band, so it is a volatility measure and says nothing about where price sits. A high %B during a narrow bandwidth is a very different setup from a high %B with wide bands.
How does raising the standard deviation multiplier change the bands and %B?
The distance from the middle band scales linearly with the multiplier, so moving from 2 to 3 puts each band half as far again from the average and lifts bandwidth by the same 50 percent. Because %B measures position within a now wider channel, an unchanged price reads closer to 50. Wider settings produce fewer band touches and fewer signals, which cuts false triggers at the cost of later entries.
Why do the bands contract sharply when an old volatile candle leaves the lookback window?
A simple moving average and its standard deviation weight every close in the window equally, so a single outlier keeps the deviation inflated for the whole n periods and then drops out in one step. When it exits, the bands can snap inward even though the current bar was unremarkable. Check whether a sudden narrowing coincides with an old spike leaving the window before treating it as a genuine volatility squeeze.
What is the difference between Bollinger Bands and Keltner Channels?
Both draw an envelope around a moving average, but the width comes from different maths. Bollinger Bands use a multiple of the standard deviation of closing prices, so they respond to how scattered the closes are. Keltner Channels use a multiple of Average True Range around an exponential moving average, so they respond to the full high-low range including gaps. Some traders flag a squeeze specifically when the Bollinger Bands contract inside the Keltner Channels.
References
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer · Editorial policy
Related Calculators
🧮Keltner Channel Calculator
Calculate Keltner Channel bands using EMA and ATR for volatility-based entries and exits.
🧮Donchian Channel Calculator
Calculate Donchian Channel upper and lower bands based on N-period highs and lows.
🧮Pip Calculator
Calculate pip with inputs, formulas, and instant results.
🧮Forex Margin Calculator
Calculate forex margin with inputs, formulas, and instant results.
🧮Forex Profit Calculator
Calculate forex profit with inputs, formulas, and instant results.
🧮Spread Cost Calculator
Calculate spread cost with inputs, formulas, and instant results.
🧮Forex Commission Calculator
Calculate forex commission with inputs, formulas, and instant results.
🧮Currency Pair Correlation Calculator
Calculate currency pair correlation with inputs, formulas, and instant results.