CommodityChannelIndex
indicator and calculates the values of the commodityChannelIndex indicator over all sub-periods of a given length.Parameters
- seriesName
- The name of the series which will be displayed on the chart, i.e. its label.
- s
- A series where the first element is the high in the last trading period, the second term is the high in the previous period and so on.
- lengthOfPeriod
- An integer which represents the length of the period over which the indicator will be iteratively evaluated.
Exception | Description |
---|---|
System.ArgumentException | Thrown if any elements from the highs, lows or closes are strictly negative, or if the length of the arrays is not equal or the lengthOfPeriod is grater than the length of the array high. |
Lambert originally commended that the CCI was designed to capture the trade cycle (i.e. low-to-low or high-to-high) turns in commodity markets. The system assumes that commodities move in cycles and uses 1/3 of the cycle period for the evaluation of the CCI. We allow the uses to specify the length of the calculation period used but we advise that you take the calculation cycle to be approximately one third of your estimate for the length of the trade cycle.
Calculation Period: the number of days used in the evaluation of the CCI. In Donald Lambert's original system this was taken to be one third of the estimate length of the trade cycle.
Remark: Within the evaluation procedure (step 2), we multiply the result by the constant 0.015. The constant was originally used in Lambert's system and has been found to ensure that around 70-80 percent of all the values given by the CCI lie the range [-100,+100]. Hence, the constant is just used to calibrate the indicator with respect to the range [-100, +100].
Interpretation
Significant signals are generated when either the CCI starts to diverge from the price action which will signify a correlation in the price, or when the CCI extended (typically above 100 or below -100) which indicates oversold or over brought conditions.
Further details concerning the CCI can be found in an article by Donald Lambert that appeared in the October 1980 issue of Commodities (now known as Futures) Magazine.
Evaluation Procedure
We summaries our basic evaluation procedure by the following three steps:
- First evaluate the simple moving average (SMA) of the Typical Price Indicator (see Filters) over the calculation period.
- Evaluate the SMA over the calculation period of the absolute value on each on the calculation period days between the Typical Price on that day and the SMA found in step 1 above, and multiply the result by 0.015.
- Divide todays typical price minus the SMA of the typical price found in step 1, by the result given by step 2.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2