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
periodintThe period of the standard deviation and moving average (middle band)
kdoubleThe number of standard deviations specifying the distance between the middle band and upper or lower bands
movingAverageTypeMovingAverageTypeThe 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
namestringThe name of this indicator
periodintThe period of the standard deviation and moving average (middle band)
kdoubleThe number of standard deviations specifying the distance between the middle band and upper or lower bands
movingAverageTypeMovingAverageTypeThe 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
LowerBand
Gets the lower Bollinger band (middleBand - k * stdDev)
public IndicatorBase LowerBand { get; }
Property Value
MiddleBand
Gets the middle Bollinger band (moving average)
public IndicatorBase MiddleBand { get; }
Property Value
MovingAverageType
Gets the type of moving average
public MovingAverageType MovingAverageType { get; }
Property Value
StandardDeviation
Gets the standard deviation
public IndicatorBase StandardDeviation { get; }
Property Value
UpperBand
Gets the upper Bollinger band (middleBand + k * stdDev)
public IndicatorBase UpperBand { get; }
Property Value
WarmUpPeriod
Required period, in data points, for the indicator to be ready and fully initialized.
public override int WarmUpPeriod { get; }
Property Value
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
timelonginputDoubleArrayThe 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()