What it measures
CCI starts from the typical price of a bar: its high, low and close added together and divided by three. It then asks how far the latest typical price is from the average of the last N of them.
A distance means little without something to compare it with, so it is divided by the mean deviation: the average distance of those N typical prices from their own average. A reading of zero means the bar is at its average. A positive reading means it is above, and a larger one means it is further above than these bars usually are.
Donald Lambert published the index in 1980 for commodity markets, hence the name; it is applied to any instrument now. He multiplied the mean deviation by a constant, 0.015, chosen so that readings would mostly lie between −100 and +100. How many actually do depends on the prices and on the length.
How it is calculated, step by step
- 01
Work out each bar’s typical price.
TP = (high + low + close) ÷ 3.
- 02
Average the last N typical prices.
A simple moving average of TP. N is usually 20.
- 03
Find how far each of those N is from that average.
Distance = |TP − average|, always as a positive number.
- 04
Average the distances.
The result is the mean deviation. It is not the standard deviation: nothing is squared.
- 05
Divide.
CCI = (latest TP − average) ÷ (0.015 × mean deviation). If the mean deviation is zero, this page shows 0.
The mean deviation is measured from the latest bar’s average for all N bars, not from the average each bar had at the time. Some programs build CCI from closes instead of typical prices, which gives a slightly different line.
A worked example, by hand
Four bars, written high / low / close: 11 / 9 / 10, then 13 / 10 / 13, then 16 / 12 / 14, then 15 / 11 / 13. Length 3.
- Typical prices: (11 + 9 + 10) ÷ 3 = 10; (13 + 10 + 13) ÷ 3 = 12; (16 + 12 + 14) ÷ 3 = 14; (15 + 11 + 13) ÷ 3 = 13
- Bar 3: average of 10, 12, 14 = 12. Distances from 12: 2, 0, 2. Mean deviation = 4 ÷ 3 = 1.333
- CCI = (14 − 12) ÷ (0.015 × 1.333) = 2 ÷ 0.02 = +100
- Bar 4: average of 12, 14, 13 = 13. Distances from 13: 1, 1, 0. Mean deviation = 2 ÷ 3 = 0.667
- CCI = (13 − 13) ÷ (0.015 × 0.667) = 0
One bar took the reading from +100 to 0. The price fell by 1; the average rose by 1 because a low bar left the window. Both moved the reading.
The numbers in this example were chosen to be easy to add up. They are not prices of anything.
How people read it
- The +100 and −100 lines. A reading beyond them means the typical price is further from its average than usual. Lambert read a move above +100 as the start of unusual strength; many readers now treat it the opposite way, as overbought. The same number carries both readings.
- The zero line. Above it, the typical price is above its average; below it, under.
- Divergence. The price makes a higher high while CCI makes a lower one. It is read as a move losing pace, and is clearer afterwards than at the time.
- Extremes. Because there are no limits, readings of ±200 or beyond occur. They show a bar far outside its recent habit, and nothing about the next one.
What it cannot tell you
- It cannot say that a reading beyond ±100 will be followed by a return. In a steady trend CCI stays beyond the line for many bars.
- It cannot promise how many readings fall between the lines. The constant was chosen with that in mind; the share on any chart is whatever it turns out to be, and the chart on this page counts it.
- It cannot be compared across lengths. A short CCI swings beyond ±100 far more often than a long one on the same prices.
- It cannot hold still. When an unusual bar leaves the window, the average and the mean deviation both change, and the reading can jump while the price barely moves.
Common mistakes
- Treating +100 as a ceiling. There is none.
- Using it as both a breakout signal and an overbought signal on the same chart, and remembering whichever was right.
- Shortening the length until every past turn shows an extreme reading.
- Reading a large number as a large price move. After a quiet stretch the mean deviation is small, and a modest move gives a large reading.
Questions people ask
- What is the 0.015 in the CCI formula?
- A scaling constant. Donald Lambert, who published the index in 1980, chose it so that most readings would fall between −100 and +100, which makes readings beyond those lines stand out. It changes the size of the numbers and nothing else: the shape of the line is the same with any constant.
- Is a CCI above +100 a buy signal or a sell signal?
- Neither, by itself. It says the typical price is unusually far above its recent average. One tradition reads that as strength and another as overbought, and both have cases where what followed fitted and cases where it did not. The reading describes where the price is, not where it is going.
- Is CCI only for commodities?
- No. The name records where it was first published. The arithmetic uses only highs, lows and closes, and it is applied to currencies, indices and shares in the same way.
The words on this page
An indicator is arithmetic on prices that have already happened. It describes what a price did; it does not predict what a price will do. The chart on this page is invented: a seeded random walk, not a market. This page is an explanation for study. It is not advice, a recommendation or a forecast, and nothing an indicator shows says anything certain about what a price will do next.
