What Is a Worked Example of Bollinger Bands?

Explore What is a worked: mechanics, differences, limitations, and practical checks.

Mechanism: definition and the moving parts

Bollinger Bands are a volatility indicator built from three lines calculated from a price series over a chosen window length.

  • Basis (middle band): typically a simple moving average (SMA) of the last N prices.
  • Standard deviation (volatility measure): the standard deviation of those same N prices around the basis.
  • Upper and lower bands: basis plus/minus a multiple of the standard deviation.

A common formula is:

  • Middle band = SMA(N)
  • Upper band = SMA(N) + k × SD(N)
  • Lower band = SMA(N) − k × SD(N)

Where:

  • N is the window length (for example, 20 periods in many chart settings).
  • k is the standard-deviation multiplier (commonly 2).

Worked numerical example with explicit assumptions

This example uses only made-up numbers so the calculations can be checked.

Assumptions

  1. We use SMA (not EMA) for the middle band.
  2. We use window length N = 5 periods.
  3. We use multiplier k = 2.
  4. The “price” series is a set of five closing prices in one consistent unit (e.g., a hypothetical exchange rate).
  5. We compute the standard deviation as the population standard deviation (divide by N), not sample standard deviation.

Given prices

Assume the last five closing prices are:

  • P1 = 1.1000
  • P2 = 1.1020
  • P3 = 1.1010
  • P4 = 1.1030
  • P5 = 1.1040

Step 1: compute the basis (SMA)

SMA = (1.1000 + 1.1020 + 1.1010 + 1.1030 + 1.1040) / 5 = 5.5100 / 5 = 1.1020

Step 2: compute the standard deviation (SD)

Compute deviations from the basis (1.1020):

  • (1.1000 − 1.1020) = −0.0020
  • (1.1020 − 1.1020) = 0.0000
  • (1.1010 − 1.1020) = −0.0010
  • (1.1030 − 1.1020) = 0.0010
  • (1.1040 − 1.1020) = 0.0020

Square them:

  • (−0.0020)² = 0.000004
  • 0.0000² = 0
  • (−0.0010)² = 0.000001
  • (0.0010)² = 0.000001
  • (0.0020)² = 0.000004

Sum of squared deviations = 0.000004 + 0 + 0.000001 + 0.000001 + 0.000004 = 0.000010

Population variance = 0.000010 / 5 = 0.000002 Population SD = √0.000002 ≈ 0.0014142

Step 3: compute the bands

Upper band = 1.1020 + 2 × 0.0014142 = 1.1020 + 0.0028284 = 1.1048284

Lower band = 1.1020 − 2 × 0.0014142 = 1.1020 − 0.0028284 = 1.0991716

So with these assumptions, the Bollinger Bands are approximately:

  • Middle: 1.1020
  • Upper: 1.1048
  • Lower: 1.0992

What you can verify yourself

  • If you change N or k, the bands change.
  • If you use sample SD instead of population SD, the SD (and thus the bands) will differ slightly.

Limitations and failure modes (what the example cannot guarantee)

  1. Parameter sensitivity: Different choices of N and k produce different band width and different “touch” behavior, even with the same price data.

  2. Volatility regime changes: Standard deviation is a historical measure. When market behavior shifts (for example, from calm to fast moves), bands can widen or narrow quickly and may no longer reflect “typical” movement.

  3. Descriptive, not predictive: Being near or outside a band describes where price sits relative to a recent range. It does not, by itself, specify that a move will reverse or continue.

  4. Data and method mismatch: Using SMA vs EMA, population SD vs sample SD, or different price inputs (close vs typical price) changes computed bands. So two charts may show different bands for the same underlying instrument.

  5. Execution and costs are not included: Even if bands are computed accurately from prices, real outcomes are affected by spreads, commissions, slippage, and trading constraints—factors not represented in the indicator math.

How to independently verify and what to check next

To verify a Bollinger Bands calculation, do the same steps as above on your own chosen data:

  1. Pick N and k.
  2. Compute the chosen middle-band method (SMA or another moving average).
  3. Compute the standard deviation consistently with the same definition (population or sample).
  4. Apply upper/lower formulas.

A useful next question is: Which calculation conventions does your charting tool use (SMA vs EMA, and which standard-deviation convention)? That choice can change the exact band values.

Trading foreign exchange and CFDs involves substantial risk. Information on FoxiForex is educational and is not personal financial advice. Sponsored placements are labelled clearly.