Momentum & oscillatorsCommodity Channel Index · CCI
How far price has strayed from its statistical average — unbounded, centred on zero.
Works in most conditionsEngine-computed on a fixed sample series
What it is
The Commodity Channel Index (CCI), developed by Donald Lambert in 1980, is a momentum oscillator that measures how far the current price has strayed from its statistical average, expressed in units of typical deviation. Despite the name it is not limited to commodities; Lambert originally designed it to spot cyclical turns in commodity futures, but it is applied to stocks, indices, and forex today. It answers whether price is unusually high or low relative to where it has recently been trading, which flags overbought and oversold conditions and the emergence of new trends. It is unbounded, so unlike RSI it has no fixed 0-to-100 ceiling, but it is calibrated so that most readings fall between -100 and +100. Moves beyond those levels mark statistically unusual departures from the mean.
How it is calculated
First compute the Typical Price for each bar, TP = (High + Low + Close) / 3. Then take a simple moving average of the Typical Price over n periods, with 20 the standard default, and compute the Mean Deviation, which is the average of the absolute differences between each bar's TP and that SMA over the window. The oscillator is CCI = (TP - SMA of TP) / (0.015 x Mean Deviation). Lambert's constant of 0.015 is a scaling factor chosen so that roughly 70 to 80 percent of CCI values land within the -100 to +100 range, which makes those levels meaningful reference points. When price is far above its average relative to normal deviation, CCI is strongly positive; far below, strongly negative; near the average, close to zero. The use of mean absolute deviation rather than standard deviation is a defining quirk of the formula.
Reading it, step by step
There are two schools of reading CCI. The reversal school treats +100 and -100 as overbought and oversold: a move above +100 that falls back below it is a sell signal, and a move below -100 that climbs back above it is a buy, fading the extreme. The trend school treats the same crossings as breakouts: a push above +100 signals a strong new uptrend to join and a drop below -100 a strong downtrend, because in real trends CCI can stay beyond its 100 levels for extended runs. The zero line acts as a momentum pivot, with crosses marking shifts between bullish and bearish bias. Divergence between price and CCI, where price makes a new high while CCI makes a lower high, warns of weakening momentum. Which school applies depends on whether the market is ranging, in which case you fade, or trending, in which case you follow.
Best timeframes and settings
Lambert's default is 20 periods, which he derived as roughly one-third of a cycle, and it is applied across daily and intraday charts on stocks, futures, indices, and forex. Shorter settings like 14 make CCI faster and more prone to reaching extremes, better for short-term trading, while longer settings like 30 to 50 smooth it for position-level analysis. A key practical point is to match the period to about a third of the dominant cycle length you are trading, as Lambert intended. It works on any liquid instrument because it standardises departures from the mean. The trade-off is familiar: shorter periods catch turns and breakouts sooner but generate more false 100-level crossings, and longer periods filter noise but lag.
When and where to use it
Use CCI when you want a flexible oscillator that can serve either as an overbought and oversold fade tool in ranges or as a breakout and trend tool when price pushes beyond its 100 levels. It suits liquid stocks, futures, indices, and forex across daily and intraday charts. It is particularly useful for cyclical markets, its original design purpose, where price swings around a mean in fairly regular cycles. The decision of whether to fade or follow its extremes should be governed by the prevailing regime, so it pairs well with a trend filter. Avoid mechanically fading every 100-level reading in a strong trend, which is the most common way traders lose money with it.
Strategies that use it
Extreme reversion: in a ranging market, sell when CCI rises above +100 and drops back under it, and buy when it falls below -100 and climbs back over, targeting the zero line. Breakout trend entry: in a trending market, buy when CCI crosses above +100 for the first time in a while, treating it as trend confirmation, and hold while it stays elevated. Zero-line trade: use crosses of the zero line as momentum entries in the direction of the larger trend. Divergence trade: act on price and CCI divergences at highs and lows with a price trigger. The unifying discipline is to read the regime first and then decide whether CCI's extreme means fade or follow.
Combining it with other indicators
CCI benefits enormously from a trend filter such as a moving average or ADX, which tells you whether to fade or follow its 100-level signals. Support and resistance mark where reversion trades become actionable. A higher-timeframe CCI or moving average provides trend context, so a short-term CCI oversold reading is only bought when the higher timeframe is bullish. Volume tools confirm breakouts through the 100 levels, and momentum peers like RSI corroborate divergences. The recurring theme is that CCI's ambiguity, where the same signal means opposite things in different regimes, makes a regime-defining companion indicator essential rather than optional.
Where it fails
CCI's core weakness is that its signals invert with regime: fading a +100 reading is right in a range and disastrous in a trend, so used without regime awareness it whipsaws badly. Because it is unbounded and unsmoothed relative to some oscillators, it can produce frequent 100-level crossings in volatile markets that lead nowhere. Its mean-absolute-deviation denominator can behave oddly during volatility spikes, distorting readings. Divergences can be early and repeatedly wrong in strong trends. The remedies are to always establish the regime first, to widen thresholds or lengthen the period in choppy markets, and to demand price confirmation rather than trading raw crossings.
A worked example
Suppose a stock's current bar has high 52, low 48, and close 50, so its Typical Price is (52 + 48 + 50) / 3 = 50. Assume the 20-period SMA of the Typical Price is 47, and the Mean Deviation, the average absolute gap between each bar's TP and that average over the 20 bars, works out to 2. Then CCI = (50 - 47) / (0.015 x 2) = 3 / 0.03 = +100, sitting exactly at the overbought and breakout threshold. If the market is ranging, a trader would watch for CCI to fall back below +100 as a signal to fade the move toward the mean; if the market is clearly trending up and CCI has just pushed above +100 for the first time in weeks, the same reading is instead read as breakout confirmation to join the trend. The identical number carries opposite meaning depending on regime, which is why CCI is always read with trend context.