Bollinger Bands
Bollinger Bands consist of a middle band (SMA) with upper and lower bands based on standard deviations.
Registration Name: "BOLLINGER"
Parameters:
period
(required): Period for the middle band SMAfield
(required): Price field to usemultiplier
(optional): Number of standard deviations for bands (default: 2)
Returns: Three components accessible via different methods:
getValue()
: Middle band (SMA)getBands()
: Object containing all three bands:middle
: SMA valueupper
: Upper band (SMA + multiplier * StdDev)lower
: Lower band (SMA - multiplier * StdDev)
registerIndicator("BOLLINGER", "BUILTIN", {
period: 20,
field: "close",
multiplier: 2
}, "BB_20_CLOSE"); // Custom ID for this instance