Library · Indicators
CCI (Commodity Channel Index)
CCI measures how far the typical price is from its moving average, scaled by how far it usually strays; it has no fixed bounds and uses +100 and -100 as reference levels.
Why it matters
“Price is above its average” is a weak statement. Above by how much, compared with what is normal for this market? The Commodity Channel Index, or CCI, answers that by dividing the distance from the average by the typical size of that distance.
CCI was introduced by Donald Lambert in 1980 for commodity markets, which explains the name. Nothing in the formula is specific to commodities, and it is applied to any market with highs, lows and closes. It is also a clear case of one reading being interpreted in two opposite ways, which is a useful lesson about indicators in general.
What it looks like
CCI is a single line in a separate panel. It is positive when the typical price is above its moving average and negative when it is below.
- Above +100> +100The typical price is unusually far above its average. There is no upper limit.
- Between-100 to +100Where most readings fall. Zero means the typical price equals its average.
- Below -100< -100The typical price is unusually far below its average. There is no lower limit.
In plain words
Think of a dog on a walk with its owner. The owner is the average and the dog is price. CCI does not just measure how far the dog is from the owner. It compares that distance with how far this particular dog usually roams. A calm dog ten steps away is a notable event. An excitable dog ten steps away is ordinary. Either way, the measurement describes where the dog is now, not where it runs next.
How it is calculated
- Typical priceAverage the high, low and close of each period.
- AverageTake the simple moving average of the typical price, commonly over 20 periods.
- Mean deviationMeasure how far, on average, each typical price in the window sits from that average.
- ScaleDivide the current distance by 0.015 × the mean deviation.
CCI = (typical price - SMA of typical price) / (0.015 × mean deviation)Typical price = (high + low + close) / 3. Mean deviation = the average absolute distance between each typical price in the window and the SMA.Lambert chose the constant 0.015 so that the majority of readings would fall between -100 and +100. That is the only reason those two levels are used.
A five-period CCI by handHypothetical illustration
All prices are hypothetical. A 5-period window is used to keep the arithmetic short. The common setting is 20.
The last five typical prices are 98, 99, 100, 101 and 102.
- SMA = (98 + 99 + 100 + 101 + 102) / 5 = 500 / 5 = 100.
- Distances from the SMA = 2, 1, 0, 1 and 2.
- Mean deviation = (2 + 1 + 0 + 1 + 2) / 5 = 6 / 5 = 1.2.
- CCI = (102 - 100) / (0.015 × 1.2) = 2 / 0.018 = about 111.
The latest typical price is 2 above the average, in a window where the usual distance is 1.2. That is far enough to put CCI just beyond +100.
Settings and what they change
| Setting | Effect | Trade-off |
|---|---|---|
| Shorter period (for example 10) | Line is jumpy and crosses +100 and -100 often | Many brief excursions that fade |
| Common period (20) | The value on most platforms | A middle ground |
| Longer period (for example 50) | Line is smoother and spends more time near zero | Slow to reflect a change |
The period sets both the average and the yardstick for “unusual”. After a very quiet stretch the mean deviation is tiny, so a modest move produces an enormous reading. Changing the period or redrawing the levels at +200 and -200 until past readings line up with past turns is overfitting.
How to read it
- Above zero: the typical price is above its average. Below zero: it is below.
- Crossing +100 or -100: the distance from the average has become large relative to recent behaviour.
- Returning inside the levels: the distance has shrunk, either because price came back or because the average caught up.
- Divergence: some traders compare CCI peaks and troughs with those of price. See divergence.
AS STRENGTH
A move beyond +100 or -100 is read as an unusually strong move.
- Closer to the original use
- Fits trending conditions better
- Fails when the move stalls at once
AS STRETCH
A reading beyond +100 or -100 is read as price being far from its average.
- The common oscillator use
- Fits sideways conditions better
- Fails when a trend keeps running
The two readings in the figure contradict each other, and both are in common use. Which one describes the market better depends on market structure: whether price is trending or moving in a range. CCI cannot tell you which of the two you are in.
Going deeper
CCI is unbounded, unlike RSI or Williams %R. In a bounded oscillator a strong trend pins the line near its limit. In CCI a strong trend can push the line to +200 or beyond, and it then drifts back toward zero even while price keeps rising, because the moving average catches up. A falling CCI above zero therefore often describes a trend that is still intact but no longer accelerating.
CCI is also a close cousin of Bollinger Bands. Both ask how far price is from a 20-period average in units of typical dispersion. Bollinger Bands use standard deviation and draw the answer on the chart. CCI uses mean deviation and draws it in a panel. Using both mostly repeats one measurement.
What it does NOT mean
- A reading above +100 does not mean “overbought, so price falls”. It can equally mark the early part of a strong advance.
- A reading below -100 does not mean price is cheap. CCI measures distance from an average, not value.
- +100 and -100 are not limits. They are reference lines produced by a chosen constant.
- A cross of the zero line is not a signal. It records that the typical price passed its own moving average.
Common mistakes
- Treating it like a bounded oscillator. Waiting for a “maximum” makes no sense when there is none.
- Applying one interpretation everywhere. The stretch reading struggles in trends and the strength reading struggles in ranges.
- Ignoring quiet periods. Small mean deviation inflates readings, so extreme values after calm markets can reflect small moves.
- Pairing it with similar tools. CCI, RSI and Williams %R are all momentum oscillators built from recent prices.
- Optimising period and levels. Settings fitted to history describe that history.
Risks and limitations
- CCI is calculated entirely from past highs, lows and closes.
- Its scale is not comparable across settings, and extreme values have no fixed meaning.
- It contains no information about volume, liquidity or news.
- It can describe how unusual the current distance from the average is. It cannot say whether that distance grows or shrinks next.
Key takeaway
CCI expresses the gap between the typical price and its average in units of the usual gap, with +100 and -100 as conventional reference lines. The same reading is read as strength by some and as stretch by others, so it is context, never a signal.
Sources and further reading
- Technical Analysis of the Financial Markets, John J. Murphy (1999). Describes Donald Lambert's Commodity Channel Index and its common uses