GlossaryCommodity Channel Index (CCI)

Commodity Channel Index (CCI)

The Commodity Channel Index measures how far a candle's typical price is from its moving average, in units of mean deviation. Donald Lambert developed it for commodities, but it works on any market. It helps you spot unusually strong swings and the start of new moves.

Calculation

HtH_t, LtL_t and CtC_t are a candle's high, low and close, and nn is the CCI length.

1. Typical price:

TPt=Ht+Lt+Ct3\mathrm{TP}_t = \frac{H_t + L_t + C_t}{3}

2. Simple moving average over the last nn candles:

SMAt=1n∑i=0n−1TPt−i\mathrm{SMA}_t = \frac{1}{n}\sum_{i=0}^{n-1} \mathrm{TP}_{t-i}

3. Mean absolute deviation of all nn values from the current average:

MDt=1n∑i=0n−1∣TPt−i−SMAt∣\mathrm{MD}_t = \frac{1}{n}\sum_{i=0}^{n-1} \left\lvert \mathrm{TP}_{t-i} - \mathrm{SMA}_t \right\rvert

4. CCI:

CCIt=TPt−SMAt0.015⋅MDt\mathrm{CCI}_t = \frac{\mathrm{TP}_t - \mathrm{SMA}_t}{0.015 \cdot \mathrm{MD}_t}

The mean absolute deviation is not a standard deviation. Calculated with a standard deviation, the CCI values would sit noticeably closer together. Lambert chose the constant 0.015 so that about 70 to 80% of the values fall between −100 and +100. If MDt=0\mathrm{MD}_t = 0, there is no value. The first value appears on candle nn.

How to read it

The curve is red from +100 up, green at −100 and below, and gray in between. Reference lines sit at −100, 0 and +100.

  • Extremes: Above +100 the typical price is unusually far above its average, below −100 unusually far below it. There is no fixed upper or lower limit; in strong moves, ±200 and more are possible.
  • Two readings: As a trend signal, a rise above +100 counts as the start of a strong upward move, a fall below −100 as the start of a downward move. As a counter-signal, what counts is the return from an extreme zone into the range in between. Which reading fits depends on whether the market is trending or moving sideways.
  • Zero line: Above zero the typical price is above its average, below zero below it.
  • Divergences: A new price high with a lower CCI high shows fading momentum, and the mirror image applies at a low.

Settings

SettingDefaultEffect
CCI length20Window nn for the average and the deviation (2–100). Shorter swings further and more often.

Limitations

  • Because the CCI is unbounded, what counts as “extreme” differs by symbol and interval. Look at the values a symbol has reached in the past.
  • In very quiet phases the mean deviation gets small, and even small moves produce large swings.

Related indicators