How Bollinger Band Strategies Are Calculated

Explain Bollinger Bands calculation parameters and data requirements.

Direct answer

Bollinger Band Strategies are not calculated as a single “strategy formula.” Instead, the core indicator behind many strategies—Bollinger Bands—is calculated in a repeatable way from a price time series. In its standard form, you compute a moving average (the middle band) and add and subtract a multiple of the rolling standard deviation (the upper and lower bands).

Because strategies built on Bollinger Bands typically use these three bands, understanding the band calculation is the key fact you can independently verify.

Mechanism and definition

What the components mean

  1. Input price series: A sequence of numbers over time, usually derived from market prices (for example, the close price for each bar). Different platforms may use different definitions of the “price” input.
  2. Rolling moving average (middle band): The average of the last N price observations.
  3. Rolling standard deviation (volatility measure): A measure of how much prices vary around the rolling mean over the same N observations.
  4. Band width factor (k): A multiplier that sets how far the upper and lower bands sit away from the middle band.

Standard Bollinger Band formula

Let Pₜ be the chosen price at time t.

Middle band (SMA):

  • (MB_t = \frac{1}{N}\sum_{i=0}^{N-1} P_{t-i})

Rolling standard deviation:

  • (SD_t = \sqrt{\frac{1}{N}\sum_{i=0}^{N-1}(P_{t-i}-MB_t)^2})

Upper and lower bands:

  • (UB_t = MB_t + k\cdot SD_t)
  • (LB_t = MB_t - k\cdot SD_t)

In many common setups, N is 20 and k is 2, but the calculation itself is defined for any chosen N and k.

Assumptions you must fix before calculating

To reproduce results from a charting tool, you need to decide:

  • N (lookback length): how many past bars are included.
  • k (band multiplier): how wide the bands are.
  • Which price series Pₜ: close, typical price, or another platform-specific definition.
  • Standard deviation convention: some implementations use population vs. sample standard deviation. Both are plausible mathematically, and they can produce slightly different band values.

Without these choices, two “Bollinger Bands” drawn on the same visible chart could differ.

Evidence via a checkable example

Below is a simple numerical example that matches the formulas above.

Example setup

Assume:

  • Lookback length N = 3
  • Band multiplier k = 2
  • Chosen price series is the close price

Suppose the last three prices are:

  • (P_{t-2}=100)
  • (P_{t-1}=102)
  • (P_{t}=101)

Step 1: middle band

(MB_t = (100 + 102 + 101)/3 = 303/3 = 101)

Step 2: rolling standard deviation (using the population form with denominator N)

Deviations from the mean:

  • (100 - 101 = -1) → square: 1
  • (102 - 101 = 1) → square: 1
  • (101 - 101 = 0) → square: 0

Sum of squares = 2

(SD_t = \sqrt{(2/3)} \approx 0.8165)

Step 3: upper and lower bands

(UB_t = 101 + 2\cdot 0.8165 \approx 101 + 1.633 = 102.633)

(LB_t = 101 - 2\cdot 0.8165 \approx 99.367)

This is exactly what you can recompute from the three chosen prices. If you change N, k, or the definition of Pₜ, you change the bands.

How “Bollinger Band Strategies” use the bands

A strategy based on Bollinger Bands usually applies rules that reference the computed bands (for example, comparisons between price and UB/LB, or the distance between price and MB). The band calculation remains the same; the “strategy” part comes from how a rule interprets those values.

Limitations and risks (material failure modes)

  1. Sensitivity to parameter choices (N and k):

    • Smaller N reacts faster to recent changes in price and volatility.
    • Larger N smooths more.
    • A larger k widens the bands; a smaller k narrows them. These changes alter where UB/LB land, even if the underlying data is identical.
  2. Data definition differences:

    • If one tool uses close and another uses a “typical price,” the input series (P_t) differs.
    • Even tiny differences in input definition can cause noticeable band differences over time.
  3. Standard deviation convention mismatch:

    • Using population vs. sample standard deviation changes (SD_t).
    • That leads to upper/lower bands that are slightly higher or lower than expected.
  4. Volatility regime effects:

    • Bands widen when recent variability increases and narrow when variability decreases.
    • A rule that assumes a “normal” spread may behave differently when volatility conditions change.
  5. No guarantee of predictive accuracy:

    • Bollinger Bands summarize recent dispersion around a mean.
    • A summary statistic can still fail to anticipate future movements, especially when price behavior changes.

Verification and next questions

Self-check method

To verify the calculation, repeat these steps on the same input data and parameter settings:

  1. Pick the exact price definition used by your source (the (P_t) series).
  2. For each time t, compute the rolling mean over N points.
  3. Compute rolling standard deviation over the same N points using the same convention.
  4. Apply (UB_t = MB_t + k\cdot SD_t) and (LB_t = MB_t - k\cdot SD_t).

If your computed bands match a charting tool, you have aligned assumptions. If not, the mismatch is usually caused by price definition or standard deviation convention.

Follow-up concept you may want

If you want to understand how Bollinger Band approaches differ from other related indicators, compare the role of mean reversion around a moving average versus indicators that track trends or momentum directly:

You can also check how parameter changes modify the bands:

If you want interpretation ideas (without treating them as standalone signals), review:

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