Lean
$LEAN_TAG$
|
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. More...
Public Member Functions | |
BollingerBands (int period, decimal k, MovingAverageType movingAverageType=MovingAverageType.Simple) | |
Initializes a new instance of the BollingerBands class More... | |
BollingerBands (string name, int period, decimal k, MovingAverageType movingAverageType=MovingAverageType.Simple) | |
Initializes a new instance of the BollingerBands class More... | |
override void | Reset () |
Resets this indicator and all sub-indicators (StandardDeviation, LowerBand, MiddleBand, UpperBand, BandWidth, B) More... | |
Public Attributes | |
override bool | IsReady => MiddleBand.IsReady && UpperBand.IsReady && LowerBand.IsReady && BandWidth.IsReady && PercentB.IsReady |
Gets a flag indicating when this indicator is ready and fully initialized More... | |
Protected Member Functions | |
override decimal | ComputeNextValue (IndicatorDataPoint input) |
Computes the next value of the following sub-indicators from the given state: StandardDeviation, MiddleBand, UpperBand, LowerBand, BandWidth, B More... | |
override IndicatorResult | ValidateAndComputeNextValue (IndicatorDataPoint input) |
Validate and Compute the next value for this indicator More... | |
Protected Member Functions inherited from QuantConnect.Indicators.Indicator | |
Indicator (string name) | |
Initializes a new instance of the Indicator class using the specified name. More... | |
Properties | |
MovingAverageType | MovingAverageType [get] |
Gets the type of moving average More... | |
IndicatorBase< IndicatorDataPoint > | StandardDeviation [get] |
Gets the standard deviation More... | |
IndicatorBase< IndicatorDataPoint > | MiddleBand [get] |
Gets the middle Bollinger band (moving average) More... | |
IndicatorBase< IndicatorDataPoint > | UpperBand [get] |
Gets the upper Bollinger band (middleBand + k * stdDev) More... | |
IndicatorBase< IndicatorDataPoint > | LowerBand [get] |
Gets the lower Bollinger band (middleBand - k * stdDev) More... | |
IndicatorBase< IndicatorDataPoint > | BandWidth [get] |
Gets the Bollinger BandWidth indicator BandWidth = ((Upper Band - Lower Band) / Middle Band) * 100 More... | |
IndicatorBase< IndicatorDataPoint > | PercentB [get] |
Gets the Bollinger B B = (Price - Lower Band)/(Upper Band - Lower Band) More... | |
IndicatorBase< IndicatorDataPoint > | Price [get] |
Gets the Price level More... | |
int | WarmUpPeriod [get] |
Required period, in data points, for the indicator to be ready and fully initialized. More... | |
Properties inherited from QuantConnect.Indicators.Indicator | |
static int | DefaultWindowSize = 2 [get] |
The default size of the history window for the indicator More... | |
Properties inherited from QuantConnect.Indicators.IIndicatorWarmUpPeriodProvider | |
int | WarmUpPeriod [get] |
Required period, in data points, for the indicator to be ready and fully initialized. More... | |
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.
Definition at line 22 of file BollingerBands.cs.
QuantConnect.Indicators.BollingerBands.BollingerBands | ( | int | period, |
decimal | k, | ||
MovingAverageType | movingAverageType = MovingAverageType.Simple |
||
) |
Initializes a new instance of the BollingerBands class
period | The period of the standard deviation and moving average (middle band) |
k | The number of standard deviations specifying the distance between the middle band and upper or lower bands |
movingAverageType | The type of moving average to be used |
Definition at line 72 of file BollingerBands.cs.
QuantConnect.Indicators.BollingerBands.BollingerBands | ( | string | name, |
int | period, | ||
decimal | k, | ||
MovingAverageType | movingAverageType = MovingAverageType.Simple |
||
) |
Initializes a new instance of the BollingerBands class
name | The name of this indicator |
period | The period of the standard deviation and moving average (middle band) |
k | The number of standard deviations specifying the distance between the middle band and upper or lower bands |
movingAverageType | The type of moving average to be used |
Definition at line 84 of file BollingerBands.cs.
|
protected |
Computes the next value of the following sub-indicators from the given state: StandardDeviation, MiddleBand, UpperBand, LowerBand, BandWidth, B
input | The input given to the indicator |
Definition at line 122 of file BollingerBands.cs.
|
protected |
Validate and Compute the next value for this indicator
input | Input for this indicator |
Override implemented to handle GH issue #4927
Definition at line 137 of file BollingerBands.cs.
override void QuantConnect.Indicators.BollingerBands.Reset | ( | ) |
Resets this indicator and all sub-indicators (StandardDeviation, LowerBand, MiddleBand, UpperBand, BandWidth, B)
Definition at line 153 of file BollingerBands.cs.
override bool QuantConnect.Indicators.BollingerBands.IsReady => MiddleBand.IsReady && UpperBand.IsReady && LowerBand.IsReady && BandWidth.IsReady && PercentB.IsReady |
Gets a flag indicating when this indicator is ready and fully initialized
Definition at line 109 of file BollingerBands.cs.
|
get |
Gets the type of moving average
Definition at line 27 of file BollingerBands.cs.
|
get |
Gets the standard deviation
Definition at line 32 of file BollingerBands.cs.
|
get |
Gets the middle Bollinger band (moving average)
Definition at line 37 of file BollingerBands.cs.
|
get |
Gets the upper Bollinger band (middleBand + k * stdDev)
Definition at line 42 of file BollingerBands.cs.
|
get |
Gets the lower Bollinger band (middleBand - k * stdDev)
Definition at line 47 of file BollingerBands.cs.
|
get |
Gets the Bollinger BandWidth indicator BandWidth = ((Upper Band - Lower Band) / Middle Band) * 100
Definition at line 53 of file BollingerBands.cs.
|
get |
Gets the Bollinger B B = (Price - Lower Band)/(Upper Band - Lower Band)
Definition at line 59 of file BollingerBands.cs.
|
get |
Gets the Price level
Definition at line 64 of file BollingerBands.cs.
|
get |
Required period, in data points, for the indicator to be ready and fully initialized.
Definition at line 114 of file BollingerBands.cs.