# Commodity Channel Index (CCI)

### Description

CCI stands for Commodity Channel Index, a measurement of the variation of a price from its statistical mean. (Note that this indicator is calculated differently from standard deviation).

The CCI was designed to reveal cyclical tendencies, best applied to commodities and other cycles with highs and lows coming at periodic intervals. Note that CCI does not show the length of cycles—it is designed to detect when cycles begin and end through the use of statistical analysis which incorporates a moving average and a divisor reflecting both the possible and actual trading ranges.

CCI was developed by Donald Lambert.

### Interpretation

The CCI fluctuates above and below zero, with approximately 70 to 80 percent of CCI values falling between -100 and +100. Large positive values (above 100) could indicate that prices are unusually high compared to average prices and hence overbought. Large negative values (below -100) could indicate prices are unusually low and hence oversold.

The indicator shades those values below and above the -100 and +100 thresholds to reveal more clearly when the currency pair may be overbought or oversold. You can change these thresholds from the default values of +100 and -100 if you want to see more (or fewer) shaded areas. Note that changing these threshold values will not affect how the graph is calculated.

The percentage of CCI values that fall between the -100 and +100 thresholds will depend on the number of periods used. A shorter period (with a shorter time series) will be more volatile, with more values falling outside of the +100 and -100 thresholds. Conversely, the more periods used to calculate the CCI, the fewer values falling outside the +100 and -100 thresholds.

### Parameters

1. n, the number of periods used to calculate the typical moving average (by default, 14)
2. The upper band above which values are shaded, indicating the currency pair is overbought (by default, 100)
3. The lower band below which values are shaded, indicating the currency pair is oversold (by default, -100)

## Formula

This formula is for an n-period CCI calculation (the default of n is 14 periods).

1. For each of the last n periods, calculate the Typical Price (TP):

2. Use these values to calculate the Typical Price Moving Average (TPMA), a simple moving average:

3. For the current period, apply the following formula:

Where A is the difference between the typical price and typical moving average for the current period:

And B is the moving average of this difference for the last n periods, then multiplied by a constant of 0.015. (This constant is used to ensure that approximately 70 to 80 percent of CCI values fall between -100 and +100.)