Skip to main content
PSX Algos

Bollinger Bands

In one line

Bollinger Bands wrap a stock's price in an upper and lower band set a couple of standard deviations from its 20-day average — they widen when the stock is volatile and pinch together when it's calm.

Bollinger Bands, created by John Bollinger, are a volatility indicator. They draw three lines around price: a middle line that is a 20-day moving average, and an upper and lower band placed a set distance above and below it. That distance is based on standard deviation — a measure of how spread out recent prices have been.

The three lines

Standard deviation simply grows when prices swing widely and shrinks when they are steady. So when a stock gets volatile, the bands spread apart; when it goes quiet, they squeeze in. Roughly speaking, price spends most of its time inside the bands, which is why touches of the outer bands draw attention.

Two numbers traders watch

A worked example

The figures below are illustrative:

DayClose (PKR)LowerMiddleUpperRead
Mon150.0146150154Calm, price mid-band
Tue150.5147150153Bands tightening
Wed154.0146150155Push toward upper band
Thu156.0144151158Bands widening — volatility up
Illustrative Bollinger Bands as volatility rises.

As the stock breaks higher on Wednesday and Thursday, the bands widen to absorb the bigger swings, and price rides the upper band — a sign of strong, but possibly stretched, momentum.

How they are used — and a caution

The default settings are a 20-day average with bands at two standard deviations. Widening to 2.5 makes touches rarer and more meaningful; narrowing makes them more frequent.

Use Bollinger Bands on PSX Algos

Bollinger Bands, %B, and band width are all available in the strategy builder. The Bollinger squeeze template uses a band-width contraction to spot quiet, coiled stocks — define your squeeze and breakout rule, then backtest it across a decade of PSX history.

Build a Bollinger Bands strategy →

Frequently asked

What are Bollinger Bands in simple terms?

They are three lines around price: a 20-day average in the middle, plus an upper and lower band set two standard deviations away. The bands widen when a stock is volatile and pinch together when it is calm.

What does %B mean?

%B shows where price sits between the bands: 1.0 is the upper band, 0.0 the lower band, and 0.5 the middle. It is a fast way to see how stretched the price is.

What is a Bollinger Band squeeze?

A squeeze is when band width falls to an unusually low level, signalling a quiet, coiled market. Traders watch for the breakout that often follows when volatility returns.

Does a touch of the upper band mean sell?

Not on its own. In a strong uptrend price can ride the upper band for a long time. A band touch needs trend context before it becomes a signal.

Related terms
Bollinger Squeeze strategyATR (Average True Range)Mean Reversion strategySMA vs EMA
By PSX Algos · Updated 14 June 2026