WebCab Technical Analysis for COM v1.1

MeanReversion.CommodityChannelIndex Method 

Evaluates the Commodity Channel Index (CCI) developed by Donald Lambert.

public double CommodityChannelIndex(
   double[] high,
   double[] low,
   double[] closing
);

Parameters

high
An array of length equal to the number of periods considered in the indicator evaluation 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.
low
An array of length equal to the number of periods considered in the indicator evaluation where the first element is the low in the last trading period, the second term is the low in the previous period and so on.
closing
An array of length equal to the number of periods considered in the indicator evaluation where the first element is the closing price in the last trading period, the second term is the closing price in the previous trading period and so on.

Return Value

The double value of the Commodity Channel Index for the considered traded period.

Remarks

The CCI measures the variation of a security's price from its statistical mean. High values show that prices are unusually high compared to average prices whereas low values indicate that prices are unusually low. The CCI can be used effectively on any type of security, but clearly it is most applicable where the security has should a strong degree on mean reversion.

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.

Note: Within the evaluation procedure (described below), 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 within the range [-100,+100]. That is, we use this constant in order to calibrate this 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:

  1. First evaluate the simple moving average (SMA) of the Typical Price Indicator (see Filters) over the calculation period.
  2. 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.
  3. Divide todays typical price minus the SMA of the typical price found in step 1, by the result given by step 2.

Exceptions

Exception TypeCondition
ArgumentExceptionThrown if any elements from the arrays high, low or close are strictly negative, or if the length of the arrays is not equal.

See Also

MeanReversion Class | WebCab.COM.Finance.Trading.Indicators Namespace