Skip to main content

Bollinger Bands Calculator

Calculate bollinger bands with our free Bollinger bands Calculator. Compare rates, see projections, and make informed financial decisions.

Share this calculator

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.595\nStandard Deviation = sqrt(sum of squared deviations / 20) = 0.5327\nUpper Band = 45.595 + 2 x 0.5327 = 46.660\nLower Band = 45.595 - 2 x 0.5327 = 44.530\nBandwidth = (46.660 - 44.530) / 45.595 x 100 = 4.67%\n%B = (46.50 - 44.530) / (46.660 - 44.530) x 100 = 92.49%

Result: Upper: 46.660 | SMA: 45.595 | Lower: 44.530 | %B: 92.49% (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%\nTypical bandwidth ranges from 4% to 15%\nA bandwidth below 4% indicates a squeeze\n2.1% is well below the 4% threshold\nSqueeze detected โ€” expect a breakout\nMonitor 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 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. For short-term day trading on 5 to 15 minute charts, try a 10-period SMA with 1.5 standard deviations for more responsive signals. For swing trading on daily charts, the standard 20-period with 2 standard deviations is ideal. For weekly or monthly charts used in position trading, consider a 50-period SMA with 2.5 standard deviations for smoother signals. Some traders also use 21-period to align with the number of trading days in a month. Always backtest settings on your specific market before risking capital.

Is my data stored or sent to a server?

No. All calculations run entirely in your browser using JavaScript. No data you enter is ever transmitted to any server or stored anywhere. Your inputs remain completely private.

How do I interpret the result?

Results are displayed with a label and unit to help you understand the output. Many calculators include a short explanation or classification below the result (for example, a BMI category or risk level). Refer to the worked examples section on this page for real-world context.

References