Lipi Reference Lipi

Functions

talib.bbw()

Bollinger band width: the same calculation as `talib.bb`, delivered as one number instead of three bands. Its arguments match `talib.bb` exactly, including `mult` being an int.

Syntax

                talib.bbw(series float source, series int length, series int mult) → series float
              

Arguments

source required series float The series the bands are built on.
length required series int How many bars the calculation covers.
mult required series int Band multiplier. An int, not a float: a fractional multiplier is refused when the script is checked, and there is no rounding.

Return Type

series float

Example


          indicator("Bollinger Band Width (BBW)", overlay=false)
length = input.int(20, title="Length")
mult = input.int(2, title="Multiplier")
[middle, upper, lower] = talib.bb(close, length, mult)
bbw = (upper - lower) / middle
plot(bbw, title="BBW", color=color.blue)
hline(0.5, "0.5 Line", color=color.gray)