Bollinger BandWidth
All indicators

LibraryVolatility

Indicator

Bollinger BandWidth

How wide the Bollinger Bands are relative to their middle band. It turns the squeeze, the narrowing of the bands, into one number.

VolatilityOwn pane3 inputsBBW

How it is calculated

The upper band minus the lower band, divided by the middle band, as a ratio and not a percentage. The bands are the catalogue's Bollinger Bands with the same length, mult and source, so with mult 2 it is four population standard deviations divided by the moving average. A middle band of 0 gives no value. After Bollinger 2001.

Reference: Bollinger 2001, bands as TA-Lib BBANDS

How to read it

Low values mean quiet, tight bands; a reading at its lowest in months marks a squeeze that often comes before a larger move. High values follow strong moves and tend to fall back. BandWidth shows nothing about direction.

In a strategy

A squeeze filter: take breakout entries only while ctx.ind("bbw", length=20) is near its lowest level of the last 120 bars, and leave the direction to another rule.

Inputs

InputTypeDefaultRange or choices
LengthlengthWhole number20min 2, max 5000
MultipliermultNumber2min 0.1, max 10
SourcesourcePrice"close"close, open, high, low, hl2, hlc3, ohlc4, hlcc4

What it draws

LineDrawn as
BandWidthLine

Used in

No strategy template reads it yet.

OrionQuant