ta.bbw
Measure the width of the Bollinger bands relative to their average, to spot squeezes.
ta.bbw(source, length, mult)Bollinger Bandwidth: (upper - lower) / basis = 2 * mult * ta.stdev(source, length) / ta.sma(source, length), the same population standard deviation ta.bb uses. A fraction, not a percentage.
Parameters
A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.
| Name | Kind | Type | Default | Range | Description |
|---|---|---|---|---|---|
source | Series | number | - | - | The series to read. |
length | Constant | number | 20 | 1 to 10000 | Window in observed bars. |
mult | Constant | number | 2 | 0.001 to 50 | Standard deviations from the basis. |
Output
| Name | Type |
|---|---|
value | number |
Warm-up and missing values
- Warm-up
lengthbars. Names in the warm-up are this operator’s parameters.- Missing values
- Returns na until
lengthconsecutive non-na observations are in the window. An na resets the accumulation. na when the basis is zero, because the width is expressed relative to it.
Example
ta.bbw(close, 20, 2)plot(ta.bbw(close, 20, 2), "Bandwidth 20")