Bollinger Bands Calculator
Calculate Bollinger Bands upper, middle, and lower lines from SMA and standard deviation.
Standard 20-period 2σ settings or custom multipliers.
John Bollinger created these in the early 1980s. The math is simple:
- Middle band = N-period simple moving average (default 20)
- Upper band = SMA + (k × σ)
- Lower band = SMA - (k × σ)
σ is the standard deviation of price over the same N periods. k is the multiplier, conventionally 2. With a normal distribution, 2σ contains about 95% of observations — which means roughly 5% of bars should close outside the bands. Price almost never follows a clean normal distribution, so in practice 90 to 95% of closes stay inside.
Bollinger himself published 22 rules for using the indicator. The two that matter most:
- A close outside the band is not a reversal signal by itself. It is a continuation of the existing move 70% of the time. Use bands for context, not for fading.
- Band width contracting (the “squeeze”) signals a coming volatility expansion. Direction has to come from somewhere else — Bollinger is not directional.
The squeeze setup. When current band width is at a 6-month low, big moves usually follow. Set an alert for band width crossing back above its own moving average. This is one of the few setups that has a documented edge across asset classes.
Mean reversion misuse. Beginners short the upper band and buy the lower band. In a trending market this is a wealth-destruction machine. The bands hug the trend; price walks the upper band for weeks during strong rallies. Mean-reversion trading on Bollinger only works in established ranges, and you need a separate filter (low ADX, sideways structure) to know you are in one.
Adjusting k. k = 1 contains roughly 68% of closes, way too tight. k = 2.5 contains 99% but the bands are usually too far away to be useful. k = 2 is the sweet spot for most assets and most timeframes.
Crypto traders often use k = 2.5. Volatility is fatter-tailed than equities, so 2σ is too tight; the bands break too often.