Beginner11 min read·September 22, 2026

Bollinger Bands, Drawn Out

Plenty of people have put Bollinger Bands on a chart. Far fewer could say exactly what those three lines are measuring. This isn't a page about memorizing the formula — it's about watching the bands get built, one step at a time.

Every chart below is drawn over real market data: 200 four-hour BTC/USDT candles from Binance, 3 August to 5 September 2026. Not a tidied-up illustration — actual price action, computed with the same math the 5PM Worker Simulator runs in a backtest.

1. An average — but which one

The line down the middle of a Bollinger setup is called the basis, and it's just a simple moving average. Add up the last 20 closes, divide by 20. That's the whole thing.

What a moving average does is summarize, not predict. It steps back from the bar-to-bar noise and answers one question: roughly where has price been over the last twenty bars? That's it. The average itself says nothing about what happens next — it compresses the past.

2. The window slides

A moving average moves because the stretch of bars it averages shifts forward by one every time a new bar arrives — the newest close joins, the oldest drops out. In the chart below, the shaded region is the 20 bars currently being averaged, and the violet dot is what they average to.

Building the average, one window at a time

The shaded region is the 20 bars being averaged right now. The violet dot is what they average to.

  • Price (close)
  • Basis — SMA 20
$79,22408/0309/05

BTC/USDT · 4h · Binance · 2026-08-03 → 2026-09-05

Press play to watch the 20-bar window slide right, each average it produces extending the basis line. Or drag the slider to stop anywhere you like.

Notice the basis doesn't start at the left edge. Averaging 20 bars requires 20 bars, so for the first 19 there's simply no value to plot. Every indicator has this warm-up, and it's why the opening stretch of a backtest often looks empty.

If you want moving averages themselves in more depth — how SMA and EMA differ, how period controls lag, what a golden cross actually is — the Moving Averages lesson picks up from here.

3. Where the bands come from

If the basis tells you roughly where price has been, the bands tell you how spread out it was getting there. Take the same 20 closes, compute their standard deviation, and place a line two of those deviations above the basis and another two below. Those are the upper and lower bands.

Standard deviation measures how far from the average those closes typically sat. When the last 20 bars have been grinding in a narrow range, it shrinks and the bands pull in tight against the basis. When price has been swinging, it grows and the bands flare out.

From one average to a band

The ticks at the live edge mark ±1σ and ±2σ around the basis for the current window.

  • Price (close)
  • Basis — SMA 20
  • Bands — ±2σ
  • Envelope
+2σ+1σbasis−1σ−2σ08/0309/05

BTC/USDT · 4h · Binance · 2026-08-03 → 2026-09-05

The ticks at the live edge mark ±1σ and ±2σ for the current window. Watch how far apart they drift as price gets choppier.

The standard deviation here is the population one — the variance divides by the number of samples, not samples minus one. That matches Pine Script's own default on TradingView, and it matches what the 5PM Worker Simulator computes in a real backtest.

4. Try it yourself

A Bollinger setup has exactly two knobs: the period (how many bars go into the average) and the multiplier (how many standard deviations out to place the bands). Moving them yourself beats reading about them.

Both knobs, live

Change the period and the multiplier and watch the same real data get re-banded.

  • Price (close)
  • Basis — SMA 20
  • Bands — ±2σ
08/0309/05
Bandwidth at the last bar: 8.05%

BTC/USDT · 4h · Binance · 2026-08-03 → 2026-09-05

Shorten the period and the bands hug price more closely; lengthen it and they get slower. Raise the multiplier and the envelope widens, so price escapes it less often. Hover the chart to read any bar.

One thing worth feeling here: push the multiplier to 3.0 and price almost stops leaving the envelope at all. That hasn't made anything more accurate — it has just loosened the definition. Changing a parameter doesn't change the market, it changes what you've decided to call unusual.

5. The squeeze: when the bands narrow

The width of the envelope can be read as a number in its own right: the gap between the bands divided by the basis, as a percentage, so it stays comparable across price levels. Stretches where that number gets unusually low are commonly called a squeeze.

In this window, bandwidth fell to 0.97% on 16 August 2026 — the last 20 bars had barely moved. Thirty bars later it had reached 26.56%, roughly 27 times wider.

A squeeze, and what came after it

Price and bands above, band width below — both on the same time axis.

  • Price (close)
  • Bands — ±2σ
  • Bandwidth (% of basis)
squeeze — 0.97% wide30%0%Bandwidth (% of basis)expanded to 26.6%08/0309/05

BTC/USDT · 4h · Binance · 2026-08-03 → 2026-09-05

Price and bands on top, bandwidth underneath, sharing one time axis. The trough in the lower curve is the same moment the bands are at their tightest above it.

Price did run from $62,900 at the squeeze to a peak close of $81,755 afterwards. The squeeze did not predict that.

Narrow bandwidth is a description of the past — volatility has been compressed — not a forecast that a big move is coming, still less that it's coming upward. Squeezes resolve downward too, and plenty of them just keep sitting there. This chart is one instance, not evidence of a rule.

6. %B: where in the bands is price right now

%B turns price's position inside the envelope into a single number between 0 and 1. At 0 it's sitting exactly on the lower band, at 1 exactly on the upper, and 0.5 is the basis. Above 1 means price closed outside the upper band; below 0, outside the lower one.

Its usefulness is simple: it makes "price touched the band" something you can measure rather than something you eyeball.

%B, and walking the band

%B places price inside the envelope: 0 is the lower band, 1 is the upper.

  • Price (close)
  • Bands — ±2σ
  • %B
8 bars walking the upper band1 · upper0.5 · basis0 · lower0.5608/0309/05

BTC/USDT · 4h · Binance · 2026-08-03 → 2026-09-05

The highlighted stretch is 8 consecutive bars from 19 August 2026 with %B above 0.95 — price walking the upper band rather than turning away from it.

That eight-bar run matters. If you'd been reading an upper-band touch as "overbought, expect a pullback," this stretch would have told you that eight times in a row, and been wrong each time. In a strong trend, price walking the upper band is ordinary behavior, not an anomaly.

7. One chart, two opposite readings

Probably the most important thing to understand about Bollinger Bands: the very same upper-band break is an entry signal in one strategy and an exit signal in another.

Read as a breakout, clearing the upper band means a trend is starting. Read as mean-reversion, that identical event means price has stretched too far. Toggle between the two readings below, on identical data.

The same break, read two ways

Clearing the upper band is treated as a trend starting.

  • Price (close)
  • Bands — ±2σ
  • Entry under this reading
  • Exit under this reading
08/0309/05

Entries mark closes pushing above the upper band; exits mark price falling back through the basis.

BTC/USDT · 4h · Binance · 2026-08-03 → 2026-09-05

The markers are computed from real %B crossings in this data, not placed by hand. Nothing about the data changes between the two views — only the interpretation.

The indicator doesn't tell you which reading is right. Breakout readings tend to suit stretches where trends persist; mean-reversion readings tend to suit stretches where price oscillates in a range. Which regime you're in is reliably obvious only afterwards.

That's why both exist as separate templates in the 5PM Worker Simulator — not because one is better, but because which one fits your asset on your timeframe is something you have to actually backtest to find out.

8. Common misreadings

  • The bands aren't support and resistance. They're computed from recent price and drawn after it — they follow price, they don't push it. The causation runs the other way.
  • Touching a band isn't a signal by itself. As above, a strong trend can pin price to the upper band for eight bars straight.
  • 2σ does not mean 95%. A normal distribution puts about 5% of observations beyond two standard deviations — but in the window these charts use, 17.1% of closes finished outside the bands, over three times as many. Return distributions have fatter tails than a normal curve, and σ here is itself recomputed every 20 bars.
  • A squeeze says nothing about direction. It describes compressed volatility in the past; it carries no information about which way the next move goes.
  • Changing the period or multiplier changes your definition, not the market. Widen the multiplier and "outside the band" automatically becomes a rarer event.

9. Seeing it run in the Simulator

Everything above shows up in two of the Simulator's built-in templates. Both use the same formula demonstrated on this page, and both can be backtested against real candle data for whichever exchange, symbol and timeframe you care about.

If you want to compare period and multiplier settings rather than guess at them, the Sweep tool runs a real backtest for every combination across the ranges you pick and ranks the results. All of that runs on public market data — no API key and no funds involved.

In the Simulator
  • Bollinger Band breakout filter — an optional block that allows a buy only while price closes above the upper band, the opposite read of %B mean reversion.
  • Bollinger Upper-Band Breakout Entry — an optional block that adds a buy when price closes above the upper band having been at or below it the bar before, for the sustained run a mean-reversion strategy has no rule for.
  • Bollinger Band Breakout — the breakout reading: it buys when a close clears the upper band and sells when price falls back below the basis.
  • Bollinger %B Mean-Reversion — the opposite reading: it buys when price reclaims the lower band and sells when it drops back from the upper one.