Docs

ta.bbw

Measure the width of the Bollinger bands relative to their average, to spot squeezes.

itm
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.

NameKindTypeDefaultRangeDescription
sourceSeriesnumber--The series to read.
lengthConstantnumber201 to 10000Window in observed bars.
multConstantnumber20.001 to 50Standard deviations from the basis.

Output

NameType
valuenumber

Warm-up and missing values

Warm-up
length bars. Names in the warm-up are this operator’s parameters.
Missing values
Returns na until length consecutive 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

itm
ta.bbw(close, 20, 2)
itm
plot(ta.bbw(close, 20, 2), "Bandwidth 20")