Lean
$LEAN_TAG$
|
Represents the traditional commodity channel index (CCI) More...
Public Member Functions | |
CommodityChannelIndex (int period, MovingAverageType movingAverageType=MovingAverageType.Simple) | |
Initializes a new instance of the CommodityChannelIndex class More... | |
CommodityChannelIndex (string name, int period, MovingAverageType movingAverageType=MovingAverageType.Simple) | |
Initializes a new instance of the CommodityChannelIndex class More... | |
override void | Reset () |
Resets this indicator to its initial state More... | |
Public Attributes | |
override bool | IsReady => TypicalPriceAverage.IsReady && TypicalPriceMeanDeviation.IsReady |
Gets a flag indicating when this indicator is ready and fully initialized More... | |
Protected Member Functions | |
override decimal | ComputeNextValue (IBaseDataBar input) |
Computes the next value of this indicator from the given state More... | |
Protected Member Functions inherited from QuantConnect.Indicators.BarIndicator | |
BarIndicator (string name) | |
Creates a new TradeBarIndicator with the specified name More... | |
Properties | |
MovingAverageType | MovingAverageType [get] |
Gets the type of moving average More... | |
IndicatorBase< IndicatorDataPoint > | TypicalPriceAverage [get] |
Keep track of the simple moving average of the typical price More... | |
IndicatorBase< IndicatorDataPoint > | TypicalPriceMeanDeviation [get] |
Keep track of the mean absolute deviation of the typical price More... | |
int | WarmUpPeriod [get] |
Required period, in data points, for the indicator to be ready and fully initialized. 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... | |
Represents the traditional commodity channel index (CCI)
CCI = (Typical Price - 20-period SMA of TP) / (.015 * Mean Deviation) Typical Price (TP) = (High + Low + Close)/3 Constant = 0.015
There are four steps to calculating the Mean Deviation, first, subtract the most recent 20-period average of the typical price from each period's typical price. Second, take the absolute values of these numbers. Third, sum the absolute values. Fourth, divide by the total number of periods (20).
Definition at line 32 of file CommodityChannelIndex.cs.
QuantConnect.Indicators.CommodityChannelIndex.CommodityChannelIndex | ( | int | period, |
MovingAverageType | movingAverageType = MovingAverageType.Simple |
||
) |
Initializes a new instance of the CommodityChannelIndex class
period | The period of the standard deviation and moving average (middle band) |
movingAverageType | The type of moving average to be used |
Definition at line 59 of file CommodityChannelIndex.cs.
QuantConnect.Indicators.CommodityChannelIndex.CommodityChannelIndex | ( | string | name, |
int | period, | ||
MovingAverageType | movingAverageType = MovingAverageType.Simple |
||
) |
Initializes a new instance of the CommodityChannelIndex class
name | The name of this indicator |
period | The period of the standard deviation and moving average (middle band) |
movingAverageType | The type of moving average to be used |
Definition at line 70 of file CommodityChannelIndex.cs.
|
protected |
Computes the next value of this indicator from the given state
input | The input given to the indicator |
Definition at line 94 of file CommodityChannelIndex.cs.
override void QuantConnect.Indicators.CommodityChannelIndex.Reset | ( | ) |
Resets this indicator to its initial state
Definition at line 115 of file CommodityChannelIndex.cs.
override bool QuantConnect.Indicators.CommodityChannelIndex.IsReady => TypicalPriceAverage.IsReady && TypicalPriceMeanDeviation.IsReady |
Gets a flag indicating when this indicator is ready and fully initialized
Definition at line 82 of file CommodityChannelIndex.cs.
|
get |
Gets the type of moving average
Definition at line 42 of file CommodityChannelIndex.cs.
|
get |
Keep track of the simple moving average of the typical price
Definition at line 47 of file CommodityChannelIndex.cs.
|
get |
Keep track of the mean absolute deviation of the typical price
Definition at line 52 of file CommodityChannelIndex.cs.
|
get |
Required period, in data points, for the indicator to be ready and fully initialized.
Definition at line 87 of file CommodityChannelIndex.cs.