Skip to content

๐Ÿ“ Bollinger Bands

Bollinger Bands dynamically measure volatility and draw an adaptive "normality fence" around the price.


๐Ÿ’ก Financial Meaning

When the bands are wide, the market is volatile; when they squeeze together, a breakout is imminent. A price touching the upper band signals statistical exuberance; touching the lower band signals an abnormal dip.


๐Ÿ”ข Mathematical Formulas

  1. Middle Band (expected value):

    \[ MB_t = SMA_N(C_t) \]
  2. Standard deviation of prices over the window:

    \[ \sigma_t = \sqrt{\frac{1}{N} \sum_{i=0}^{N-1} (C_{t-i} - MB_t)^2} \]
  3. Upper and Lower Bands:

    \[ Upper_t = MB_t + k \cdot \sigma_t, \qquad Lower_t = MB_t - k \cdot \sigma_t \]

With \(k = 2\), if returns were normally distributed the price would stay inside the bands ~95.4% of the time. In practice, financial returns have fat tails (leptokurtosis), so breaches are more frequent โ€” but still statistically significant.


โš™๏ธ Parameters

Parameter Key Default Description
Period (\(N\)) period 20 SMA window for expected value, in sessions.
Multiplier (\(k\)) multiplier 2 Number of standard deviations.

Drawn across closed days

The bands have a value on sessions only, while the chart's date axis runs through every calendar day. Over a weekend or a holiday, the shaded band is drawn in a straight line from the last session before to the first one after, as the middle band is, so it does not break: the bridged stretch only shapes the fill and carries no value of its own.


๐ŸŽ›๏ธ Signal Processing Equivalent โ€” Adaptive Confidence Interval Tracker

The Middle Band is a FIR (Finite Impulse Response) moving average filter โ€” the simplest low-pass with a rectangular window of length \(N\). The bands add a time-varying envelope at \(\pm k\sigma\), which is essentially a running estimate of the signal's instantaneous variance.

In the language of adaptive filters, this is an expected-value tracker with an adaptive confidence interval. When the variance \(\sigma^2\) drops (the "Bollinger Squeeze"), the system is in a low-entropy state. In chaotic systems like financial markets, low-entropy periods are reliably followed by high-entropy (high-volatility) explosions โ€” making the squeeze one of the most watched setups in technical analysis.

FIR vs IIR

Unlike the EMA (IIR, one pole), the SMA is a FIR filter with a perfectly flat group delay of \((N-1)/2\) samples. It trades off a wider transition band for zero-phase distortion โ€” ideal for centring the confidence envelope.

Bollinger Bands on Wikipedia