Skip to content

Indicator Formula

Technical Details — Bollinger Bands (BB)

Section titled “Technical Details — Bollinger Bands (BB)”

Bollinger Bands use SMA ± standard deviation multiples.


Mathematical Derivation

Purpose: Establish the center line.

$$Middle = SMA(Close, n)$$

Where:

  • $$n$$ = Period (default 20)

What This Measures: Average price over the period


Purpose: Measure price dispersion.

$$\sigma = \sqrt{\frac{\sum(Close_i - SMA)^2}{n}}$$

What This Measures: Price volatility


Purpose: Set bands at standard deviation multiples.

$$Upper = Middle + k \times \sigma$$ $$Lower = Middle - k \times \sigma$$

Where:

  • $$k$$ = Multiplier (default 2.0)

What This Measures: Statistical price boundaries


Purpose: Normalize price position within bands.

$$%B = \frac{Close - Lower}{Upper - Lower}$$

What This Measures: Where price sits within the bands (0=lower, 0.5=middle, 1=upper)



Compact Formula Summary

$$Middle = SMA(Close, n)$$ $$Upper = Middle + k\sigma$$ $$Lower = Middle - k\sigma$$ $$%B = (Close - Lower)/(Upper - Lower)$$

Defaults: Period = 20, Multiplier = 2.0


Complete Calculation Example

With SMA = 45, σ = 1.5, k = 2: Upper = 45 + 2×1.5 = 48 Lower = 45 - 2×1.5 = 42 If Close = 47: %B = (47-42)/(48-42) = 0.83 (near upper band)


Key Takeaways from the Example
  1. Band Width: Wider bands = more volatile, narrower = less volatile
  2. %B: 0 = at lower band, 1 = at upper band, >1 = above upper band
  3. Squeeze: Very narrow bands often precede large moves