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
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 20 | min 2, max 5000 |
Multipliermult | Number | 2 | min 0.1, max 10 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| BandWidth | Line |
Used in
No strategy template reads it yet.