Table of Contents

Class BollingerBands

Namespace
FinanceSharp.Indicators
Assembly
FinanceSharp.dll

This indicator creates a moving average (middle band) with an upper band and lower band fixed at k standard deviations above and below the moving average.

public class BollingerBands : Indicator, IIndicator, IUpdatable
Inheritance
BollingerBands
Implements
Inherited Members
Extension Methods

Constructors

BollingerBands(int, double, MovingAverageType)

Initializes a new instance of the BollingerBands class

public BollingerBands(int period, double k, MovingAverageType movingAverageType = MovingAverageType.Simple)

Parameters

period int

The period of the standard deviation and moving average (middle band)

k double

The number of standard deviations specifying the distance between the middle band and upper or lower bands

movingAverageType MovingAverageType

The type of moving average to be used

BollingerBands(string, int, double, MovingAverageType)

Initializes a new instance of the BollingerBands class

public BollingerBands(string name, int period, double k, MovingAverageType movingAverageType = MovingAverageType.Simple)

Parameters

name string

The name of this indicator

period int

The period of the standard deviation and moving average (middle band)

k double

The number of standard deviations specifying the distance between the middle band and upper or lower bands

movingAverageType MovingAverageType

The type of moving average to be used

Properties

IsReady

Gets a flag indicating when this indicator is ready and fully initialized

public override bool IsReady { get; }

Property Value

bool

LowerBand

Gets the lower Bollinger band (middleBand - k * stdDev)

public IndicatorBase LowerBand { get; }

Property Value

IndicatorBase

MiddleBand

Gets the middle Bollinger band (moving average)

public IndicatorBase MiddleBand { get; }

Property Value

IndicatorBase

MovingAverageType

Gets the type of moving average

public MovingAverageType MovingAverageType { get; }

Property Value

MovingAverageType

StandardDeviation

Gets the standard deviation

public IndicatorBase StandardDeviation { get; }

Property Value

IndicatorBase

UpperBand

Gets the upper Bollinger band (middleBand + k * stdDev)

public IndicatorBase UpperBand { get; }

Property Value

IndicatorBase

WarmUpPeriod

Required period, in data points, for the indicator to be ready and fully initialized.

public override int WarmUpPeriod { get; }

Property Value

int

Methods

Forward(long, DoubleArray)

Computes the next value of the following sub-indicators from the given state: StandardDeviation, MiddleBand, UpperBand, LowerBand

protected override DoubleArray Forward(long time, DoubleArray input)

Parameters

time long
input DoubleArray

The input given to the indicator

Returns

DoubleArray

The input is returned unmodified.

Reset()

Resets this indicator and all sub-indicators (StandardDeviation, LowerBand, MiddleBand, UpperBand)

public override void Reset()