Commodity Channel Index (CCI) Calculator
Technical indicators
- Inputs: the typical price is 184.62, its simple moving average is 176.35 and the mean deviation is 4.86.
- Deviation: 184.62 - 176.35 = 8.27.
- CCI: 8.27 / (0.015 x 4.86) = 113.44.
- Commodity channel index result: 113.44 - overbought zone (above +100).
Donald Lambert published the commodity channel index in 1980, in the pages of Commodities magazine, as a tool for catching the cyclical turns of commodity prices. His construction is a standardised distance: how far today's typical price sits from its recent average, measured not in points and not in standard deviations, but in units of the average's own typical wobble - the mean deviation. Divide the distance by that wobble, scaled by his constant, and you get an index that spends most of its life between -100 and +100 whatever the commodity and whatever its price level.
This calculator takes the three finished ingredients - the typical price, its simple moving average and the mean deviation over the same period - and returns the CCI, the raw deviation, the scaled mean deviation and the zone. The examples show a reading just into overbought, a deep oversold reading and a quiet in-band one.
Worked examples
CCI just into overbought
(184.62 · 176.35 · 4.86)
| Commodity channel index (CCI) | 113.44 |
| Typical price minus its average | 8.27 |
| Scaled mean deviation (0.015 x MD) | 0.0729 |
| Signal zone | Overbought zone (above +100) |
CCI in a deep oversold dislocation
(92.18 · 101.44 · 3.92)
| Commodity channel index (CCI) | -157.48 |
| Typical price minus its average | -9.26 |
| Scaled mean deviation (0.015 x MD) | 0.0588 |
| Signal zone | Oversold zone (below -100) |
CCI quiet inside the band
(240.55 · 238.9 · 5.15)
| Commodity channel index (CCI) | 21.36 |
| Typical price minus its average | 1.65 |
| Scaled mean deviation (0.015 x MD) | 0.0773 |
| Signal zone | Inside the +100/-100 band |
Lambert's deviation ratio
The typical price is the bar's high, low and close averaged - Lambert's way of summarising a bar in one number that respects its range. Average those typical prices over the period and you have the centre. The mean deviation is the average distance of the period's typical prices from that centre: not the standard deviation, which squares the distances and so overweight the wildest bars, but the plain average distance, robust in a way that suited Lambert's hand-calculated era and still suits the statistic today.
The index is then the current deviation divided by the scaled mean deviation. In the first worked example the typical price is 184.62 against an average of 176.35, a deviation of 8.27. The mean deviation is 4.86, and scaled by Lambert's constant it becomes 0.0729. The division gives a CCI of 113.44 - the typical price sits a little more than one scaled unit above its average.
Every part of the construction is doing comparability work. Because the denominator is the instrument's own recent wobble, a CCI of 113.44 on a quiet utility stock and on a volatile commodity future describe the same statistical event: price roughly one typical excursion above its mean. That is what made the index portable across the commodity complex Lambert wrote for.
- CCI = (typical price - its SMA) / (0.015 x mean deviation).
- The typical price is (high + low + close) / 3 for each bar.
- The mean deviation is the average absolute distance from the SMA, not a standard deviation.
- Lambert's bands are +100 and -100; most readings fall between them.
Why the constant is 0.015
The 0.015 is the least mysterious magic number in technical analysis, because Lambert explained it himself: he chose it so that roughly 70 to 80 percent of a random series' CCI values would fall between -100 and +100. It is a calibration constant, not a law of nature - the reciprocal of the scaling that makes the bands mean what he wanted them to mean. Change it and every CCI ever printed changes with it, which is why no platform dares.
The calibration explains the zones' texture. A reading of 113.44, like the first example, is overbought by the letter of the bands but only just: it is the kind of excursion Lambert expected to see regularly at the edge of normal behaviour. The second example is a different species - a deviation of -9.26 against a scaled mean deviation of 0.0588 gives -157.48, far outside the band, the statistical signature of a genuine dislocation rather than a routine stretch.
The third example completes the scale: a deviation of 1.65 and a CCI of 21.36, an unremarkable bar in an unremarkable stretch, the reading the index produces most of the time. Judging any CCI starts from that base rate - the band is crossed often enough to be a working signal and rarely enough to mean something when it happens.
| CCI zone | Reading | Lambert's reading of it |
|---|---|---|
| Overbought | Above +100 | Price stretched above its average; cycle turn possible |
| In band | -100 to +100 | Normal excursion; most readings live here |
| Oversold | Below -100 | Price stretched below its average; cycle turn possible |
Worked examples
Example 1: Typical price 184.62; SMA of typical price 176.35; Mean deviation 4.86. Commodity channel index (CCI) = 113.44. Supporting values: Typical price minus its average 8.27; Scaled mean deviation (0.015 x MD) 0.0729; Signal zone Overbought zone (above +100). Inputs: the typical price is 184.62, its simple moving average is 176.35 and the mean deviation is 4.86. Deviation: 184.62 - 176.35 = 8.27. CCI: 8.27 / (0.015 x 4.86) = 113.44. Commodity channel index result: 113.44 - overbought zone (above +100).
Example 2: Typical price 92.18; SMA of typical price 101.44; Mean deviation 3.92. Commodity channel index (CCI) = -157.48. Supporting values: Typical price minus its average -9.26; Scaled mean deviation (0.015 x MD) 0.0588; Signal zone Oversold zone (below -100). Inputs: the typical price is 92.18, its simple moving average is 101.44 and the mean deviation is 3.92. Deviation: 92.18 - 101.44 = -9.26. CCI: -9.26 / (0.015 x 3.92) = -157.48. Commodity channel index result: -157.48 - oversold zone (below -100).
Example 3: Typical price 240.55; SMA of typical price 238.9; Mean deviation 5.15. Commodity channel index (CCI) = 21.36. Supporting values: Typical price minus its average 1.65; Scaled mean deviation (0.015 x MD) 0.0773; Signal zone Inside the +100/-100 band. Inputs: the typical price is 240.55, its simple moving average is 238.90 and the mean deviation is 5.15. Deviation: 240.55 - 238.90 = 1.65. CCI: 1.65 / (0.015 x 5.15) = 21.36. Commodity channel index result: 21.36 - inside the +100/-100 band.
Cycles first, overbought second
Lambert designed the CCI to identify cyclical turns - the moments a commodity's dominant cycle topped or bottomed - and his original rules traded crossings of the band in the cycle's direction, not mindless fades of every extreme. The modern habit of reading +100 as overbought and selling into it is a reinterpretation, and in a strong trend it is a costly one: a trending instrument can hold its CCI above +100 for as long as the trend persists, each bar's typical price riding above a lagging average.
This page therefore reports the zone without prescribing the trade. Whether 113.44 means take profits, add to a breakout or do nothing depends on the regime the instrument is in - the question the index was never designed to answer alone. Paired with a trend filter, the same reading becomes precise information about how far price has travelled from its own centre of gravity.
When the CCI misleads
The denominator is the vulnerability. In a dead-flat period the mean deviation shrinks toward zero, the scaled value with it, and a trivial deviation divides into a huge CCI - the same small-denominator instability every ratio indicator carries. The first defence is to read the scaled mean deviation this page reports: when 0.0729 has collapsed to a sliver of its usual size, the index built on it is an artefact.
Period choice is the second trap. Lambert's original period was tied to the cycle he was trading, and the common default of 20 is a later convention. A shorter period shrinks the average's lag and the mean deviation together, making crossings cheaper; a longer one makes the index a slower, stricter gauge. Comparing CCIs across periods is comparing different instruments.
Getting the ingredients from your platform
Platforms print the CCI but rarely its ingredients, yet all three are recoverable. The typical price of the current bar is its high, low and close averaged. Its moving average and the mean deviation come from the same window the platform's CCI uses: list the window's typical prices, average them for the SMA, then average their absolute distances from that average for the mean deviation.
The audit use is the valuable one. Feed the three ingredients here and the result should reproduce your platform's CCI to rounding - 113.44 from a deviation of 8.27 and a scaled deviation of 0.0729. If it does not, the platform is using a different period, a different typical-price definition, or a standard deviation in place of the mean deviation, and each of those is worth knowing before you trade its signals.
FAQs
What does the CCI measure?
How far the current typical price sits from its recent average, in units of that average's own mean deviation, scaled by Lambert's 0.015 constant. It is a standardised distance, comparable across instruments and price levels.
What CCI does the first worked example produce?
A typical price of 184.62 against an average of 176.35 is a deviation of 8.27; the mean deviation of 4.86 scales to 0.0729. The CCI is 113.44 - just inside Lambert's overbought zone above +100.
Why is the constant 0.015?
Lambert chose it so roughly 70 to 80 percent of a random series' readings fall between -100 and +100. It is a calibration that defines what the bands mean, which is why every implementation keeps it unchanged.
How extreme is the second example?
Very. A deviation of -9.26 over a scaled mean deviation of 0.0588 gives -157.48, far beyond the -100 oversold line - a dislocation, not a routine stretch. The third example, at 21.36, shows the ordinary in-band reading for contrast.
Is a CCI above +100 a sell signal?
Not by itself. Lambert built the index to time cyclical turns, and in a persistent trend the CCI can hold above +100 for weeks. This page reports the zone; whether an extreme means fade, follow or ignore depends on the regime, which needs a separate trend judgement.
Mean deviation or standard deviation?
Lambert specified the mean deviation - the average absolute distance from the average. It resists the wildest bars better than a standard deviation. If a platform's CCI cannot be reproduced from the mean deviation, it may be substituting the standard deviation.