In this article
After this article, you can
- Calculate final bands for two reordered price series.
- Separate price dispersion from the sequence of changes.
Terms at hand: Bollinger Bands · Backtesting · Stop loss · Average Directional Index (ADX) · Average True Range (ATR) · Simple Moving Average (SMA)
Bollinger Bands show price relative to an average and the dispersion of prices in a selected window. The upper line is not a ceiling and the lower one is not a floor. Two traders can assign opposite trading rules to the same chart, but neither interpretation establishes an outcome. This lesson starts with a calculation you can reproduce before studying possible applications.
What Bollinger Bands are made of
In the traditional construction, the middle line is SMA of n closing prices. Compute standard deviation σ from the same window; upper = SMA + k × σ and lower = SMA − k × σ. Each side is k × σ from the mean, while the entire channel is 2 × k × σ wide. The common (20, 2) settings are defaults, not universal optimum parameters. The period means bars of the selected timeframe, and a platform may allow another price source or basis type.
With k = 2, each band is two standard deviations from the mean and the full width is four. That arithmetic does not imply a 5% probability of a future outside close. John Bollinger warns against coverage assumptions; the calculation uses rolling price levels, not an independently estimated distribution of future returns. A tag alone does not define a complete buy or sell rule.
Two paths to the same band reading
Reorder the same four closes. Mean and standard deviation stay identical even though the charts look different.
Scroll sideways to see the full diagram
Hypothetical model: arbitrary units, four closes, n = 4 and k = 2 only for the calculation. Horizontal lines show the whole-window reading, not bands computed at every candle. Population formula: MetaTrader 5 — Bollinger Bands.
Compute one complete reading
Use hypothetical closed EUR/USD candles with n = 4 and k = 2, solely to make the arithmetic visible. The closes are 1.0990, 1.0990, 1.1010 and 1.1010 USD per EUR. SMA = 1.1000. Deviations are −0.0010, −0.0010, +0.0010 and +0.0010; each squared deviation is 0.000001. This is a teaching window, not a recommendation to trade four-period bands.
- The squared deviations sum to 0.000004. Divide by n = 4 for the population variance: 0.000001.
- Take its square root: σ = 0.0010. This is dispersion of the closing-price levels around one current-window mean, not dispersion of returns or of separate moving averages.
- Upper = 1.1000 + 2 × 0.0010 = 1.1020; lower = 1.1000 − 2 × 0.0010 = 1.0980.
- At pip 0.0001, each band is 20 pips from the mean and the full width is 40 pips.
- The last close 1.1010 is above the mean and below the upper band. That location does not supply entry, stop, size or exit rules.
Population and sample standard deviation
The MT5 formula divides the sum of squared deviations by n. A spreadsheet’s sample-standard-deviation function may divide by n − 1 instead. In the same four-price example, sample σ = √(0.000004/3) ≈ 0.00115470. With k = 2, its bands would be about 1.10230940 and 1.09769060. A wider spreadsheet result can therefore come from the denominator alone; the word “sample” does not make it the correct implementation to reproduce.
An ADX reading can be an additional recorded input, but crossing 25 does not prove that a band-bounce rule starts or stops paying. Bollinger describes band tags and walking the bands without a guaranteed result. Similarly, the candlestick-pattern descriptions can define observations; they do not independently certify a turn or a profitable fill.
Changing the window or multiplier
Each new bar moves a rolling window: the oldest observation leaves and the newest enters. Recompute both mean and dispersion. Width can change because an earlier extreme leaves the window, even without a new large move. Current-bar inputs can also change before close; label that state when comparing it with a confirmed historical reading.
- Keep the four EUR/USD closes unchanged, so SMA stays 1.1000 and population σ stays 0.0010.
- Change only k from 2 to 1.5.
- The upper line becomes 1.1015 and the lower 1.0985.
- Full width becomes 0.0030, or 30 pips at pip 0.0001.
- The narrower channel came from the setting, not changed price behaviour. Record the parameter before comparing screenshots or counting events.
Price can remain near one band during a trend, as Bollinger notes. The observation alone does not fix how long the trend lasts or where it ends. A narrow window also does not specify the timing, direction or size of a subsequent move. Define any proposed condition and its information time before testing it.
The most common mistakes in reading the bands
- Confusing a tag with an outcome. A tag describes location, not guaranteed reversal or continuation.
- Assuming a required timeframe. Bollinger allows bars of different lengths; no universal H4 boundary certifies effectiveness.
- Assuming expansion must follow a close outside. Both the mean and dispersion change with the window. A band calculation does not determine which broker stop executes.
- Counting unavailable information. A completed close and its final bands were not known throughout the open bar.
- Selecting settings after seeing results. Separate parameter development from later unused data and retain failed tests as well as favourable examples.
Band width, the underrated companion
BandWidth normalizes upper-minus-lower width by the middle line; multiply by 100 when expressing it as a percentage. With a positive middle line, this distinguishes relative width from a raw price distance. It does not include trading costs or notional exposure. The ATR calculation instead uses high, low and previous close; raw ATR is not already a percentage or the same dispersion statistic.
A squeeze rule may compare BandWidth with an explicitly chosen reference window. That is a definition to record, not an automatic forecast or a universal threshold. Check the platform’s scaling before using a decimal or percentage cutoff. A low historical width does not establish an outside close’s probability or the time available to execute an order.
Practical takeaway: The same mean and dispersion can come from different price sequences; identical bands do not recover that missing order.
What to do tomorrow
- Reproduce a reading. Compute one mean, population variance and both bands from a frozen set of closed prices.
- Compare the denominator. Calculate the sample-standard-deviation alternative without changing the data and note the difference.
- Change one parameter. Keep the prices fixed and change only k; distinguish an indicator-setting effect from a market change.
- Record the next question. The advanced use of Bollinger Bands lesson separates price location, BandWidth and squeeze definitions. Any trading use still needs complete rules, costs and testing.
Check your understanding
One short exercise
About 2 min · you can try again
The same four prices are reordered, preserving the final price and band settings. Does final band width change?
- No, their mean and dispersion stay the same.
- Yes, every oscillation widens the bands.
- Yes, series A must give a stronger trend.
Check the answer and explanation
No, their mean and dispersion stay the same.
The sum and squared deviations do not depend on order. Only the path to the final reading changed.
Frequently asked
Who invented Bollinger Bands and what are they based on?
John Bollinger developed the indicator. In the traditional version, calculate SMA from n prices and set the bands at SMA ± k × standard deviation. The (20, 2) parameters are defaults, not universal optimum settings. In this lesson’s MT5-formula model, variance divides squared deviations from the same-window mean by n. The use of standard deviation does not make the bands a 95% prediction interval or give a future outside close a 5% probability.
What is BB squeeze and how to use it?
A squeeze denotes relatively narrow bands under a specified width criterion and reference window. It does not determine the timing or direction of the next move. A trading variant based on an outside close needs an explicit definition, fill assumption, stop and exit rules, costs and testing. There is no universal H4 minimum or guaranteed stop location. With n = 4, SMA and population deviation of the same included closes, a strict close beyond 2σ is mathematically impossible; different inputs or prior-window bands are different rules.
Does "price touches band" always mean reversal?
No. John Bollinger distinguishes tags from standalone buy/sell signals and notes that price can walk along a band during a trend. Neither an upper-band tag nor ADX below 25 proves a return to the middle or profitable mean reversion. Define a condition and evaluate the complete method instead of infer a guaranteed sequence of stops or wins from the chart.
What are other volatility indicators?
ATR averages True Range using high, low and previous close. In StockCharts’ modern Keltner version, channel distance is an ATR multiple around an EMA; historical Keltner construction differs. Donchian channels use the selected window’s highest high and lowest low, with their midpoint as the middle line. These process different inputs. No construction is guaranteed to be calmer on every candle or to provide an independent directional or profitable signal.
Sources & bibliography
-
John Bollinger Bollinger on Bollinger Bands · Bollinger's own book on the indicator he developed. www.bollingerbands.com ↗
-
Investopedia Bollinger Bands Definition · An explanatory reference on Bollinger Bands. www.investopedia.com ↗
-
CFA Institute CFA Institute research portal · The CFA Institute research portal provides access to investment research. www.cfainstitute.org ↗
-
John Bollinger Bollinger Bands Rules · The creator distinguishes tags from trade signals, describes walking the bands, treats 20/2 as defaults and warns against statistical coverage assumptions. These rules are not a verified win rate. www.bollingerbands.com ↗
-
MetaQuotes Bollinger Bands — Calculation · Gives SMA-based bands and the population-deviation formula with division by N. Used to reproduce the lesson’s hypothetical calculations, not to forecast execution or profit. www.metatrader5.com ↗
-
TradingView Bollinger Bands (BB) · Documents adjustable basis, period, source, standard-deviation multiplier, offset and indicator timeframe. Matching those inputs is necessary when comparing platform readings. www.tradingview.com ↗
