# Bollinger Bands

Bollinger Bands is a technical-analysis indicator that plots a moving average with upper and lower bands set a specified number of standard deviations from it.

## What it means

On a price chart, Bollinger Bands put recent price movement in context. A middle line shows a moving average; an upper and a lower line show how far prices are from that average relative to their recent variation. The conventional setting uses 20 closing prices and bands two standard deviations above and below the average, although chart settings can differ.

The bands widen when the measured variation in closing prices increases and narrow when it decreases. A close near or beyond a band describes its position relative to the selected lookback period. It does not, by itself, identify a turning point or predict the next price.

## How it is calculated

For a 20-period chart calculated from closing prices:

`Middle_t = mean(P_t, ..., P_(t-19)); SD_t = sqrt[sum((P_i - Middle_t)^2) / 20]; Upper_t = Middle_t + 2 × SD_t; Lower_t = Middle_t - 2 × SD_t`

- `P_i` is the closing price, in US$ per share, for each of the 20 periods ending at period `t`.
- `Middle_t` is the arithmetic mean of those 20 closes, in US$ per share.
- `SD_t` is their population standard deviation, in US$ per share; the sum contains 20 squared deviations. Some charting tools use a different standard-deviation convention.
- `Upper_t` and `Lower_t` are the band values for period `t`, in US$ per share. The multiplier `2` has no units and is adjustable.

A period need not be a day: on a weekly chart, for example, the calculation uses weekly closing prices. Each new period drops the oldest close and adds the newest.

## Worked example

Suppose a hypothetical stock has these five daily closing prices, in US$ per share: 98, 99, 100, 101 and 102. Use a five-day lookback and a multiplier of two to make the arithmetic visible; this is **not** the conventional 20-period setting.

1. Find the mean: `(98 + 99 + 100 + 101 + 102) / 5 = US$100`.
2. Find each deviation from the mean: −2, −1, 0, 1 and 2 US$ per share. Their squares sum to `4 + 1 + 0 + 1 + 4 = 10` (US$ per share)².
3. Divide by five and take the square root: `SD = sqrt(10 / 5) = sqrt(2) ≈ US$1.414 per share`.
4. Calculate the bands: `Upper = 100 + 2 × 1.414 ≈ US$102.83`; `Lower = 100 − 2 × 1.414 ≈ US$97.17` per share.

The last close, US$102, falls below the upper band. This calculation says where that close sits relative to these five closes, not where the stock goes next. Different lookbacks or standard-deviation conventions produce different bands.

## Why it matters before you trade

Bollinger Bands can help describe whether a proposed trade follows a recent move or occurs during a period of comparatively narrow or wide price variation. But a narrow band is not proof that a breakout is imminent, and a price above the upper band need not reverse: prices can remain near a band during a sustained move.

A pre-trade check asks separate questions about execution. How large is the order relative to typical daily volume? What bid-ask spread and market impact might it face? A chart indicator based on closing prices does not answer those questions. News, trading halts and price gaps can also change conditions that a recent-price calculation does not capture.

## How PreTrAIde uses it

The product facts do not say that PreTrAIde calculates Bollinger Bands or uses them in its verdicts. Its pre-trade analysis is not chart-pattern technical analysis. For a user-built stock basket, PreTrAIde assesses factors including estimated bid-ask spread, participation in daily volume, market impact and daily volatility before any order is placed. It returns a GO, NO-GO or MODIFY verdict with reasoning; these verdicts are decision support, not recommendations.

## Common mistakes

- **Treating a band touch as a trade instruction.** A touch states a relationship to recent closes, not a reliable direction for the next move.
- **Assuming two standard deviations means 95% containment.** The familiar 95% rule relies on assumptions that stock prices and rolling bands do not satisfy; prices are not guaranteed to stay inside.
- **Ignoring the settings.** A five-day calculation and a 20-day calculation measure different windows; changing the multiplier also changes the band widths.
- **Confusing band width with trading liquidity.** Band width reflects variation in the selected closing prices, not available order-book depth or the cost of a fill.

---
Source: https://pretraide.com/glossary/bollinger-bands
