Functions
talib.bb()
Bollinger Bands. A Bollinger Band is a technical analysis tool defined by a set of lines plotted two standard deviations (positively and negatively) away from a simple moving average (SMA) of the security's price, but can be adjusted to user preferences.
Syntax
talib.bb(series float source, series int length, series int mult) → [series float, series float, series float]
Arguments
source required series float Series of values to process. length required series int Number of bars (length). mult required series int Standard deviation factor. Return Type
[series float, series float, series float] Example
indicator("Bollinger Bands", overlay=true)
// User inputs
length = input.int(20, title="BB Length")
mult = input.int(2, title="BB Multiplier")
// Calculate Bollinger Bands
[bbMiddle, bbUpper, bbLower] = talib.bb(close, length, mult)
// Plot the bands
plot(bbMiddle, title="BB Middle", color=color.blue)
plot(bbUpper, title="BB Upper", color=color.green)
plot(bbLower, title="BB Lower", color=color.red)