Bollinger Bands

All functions · nseries package

Bollinger

func (s Series) Bollinger(length int, nbrStdDevs float64) Series

Bollinger returns a smoothed series adjusted by a specified number of standard deviations (which could be negative) determined from the specified previous number of bars.

Bars 0 to length-2 pass the input through, since Average passes it through and StdDev is 0 there, so the band equals the price on those bars.

BollingerX

func (s Series) BollingerX(length int, nbrStdDevs float64) Series

BollingerX returns a smooth series (where the smoothing function is an exponential moving average rather than the standard simple moving average) adjusted by a specified number of standard deviations (which could be negative) determined from the specified previous number of bars.

Bars 0 to length-2 pass the input through, since XAverage passes it through and StdDev is 0 there, so the band equals the price on those bars.