How it is calculated
The price minus the lower band, divided by the upper band minus the lower band. The bands are the catalogue's Bollinger Bands with the same length, mult and source (SMA plus and minus mult population standard deviations). When every price in the window is the same the bands have no width and %B has no value. After Bollinger 2001.
Reference: Bollinger 2001, bands as TA-Lib BBANDS
How to read it
Above 1 the price is above the upper band, below 0 under the lower one. Readings that stay near 1 in an uptrend show strength rather than a top. Comparing %B highs with price highs can show a divergence: price makes a new high, %B does not.
In a strategy
A rule that does not depend on the price level: buy when ctx.ind("bbp", length=20) rises back above 0 after closing below it, or take profits when it reaches 1.
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 |
|---|---|
| %B | Line |
Guide lines at 0, 1.
Used in
No strategy template reads it yet.