Commodity Channel Index
How far the current price has deviated from its statistical mean. Originally built for cyclical commodities; widely used across all asset classes today.
Commodity Channel Index on GLD, daily candles. Data via Financial Modeling Prep, cached server-side.
Quick reference
The Commodity Channel Index was built by Donald Lambert in 1980 specifically to identify cyclical turning points in commodity markets. The name reflects its origin; the math is asset-agnostic and CCI is now used across stocks, futures, forex, and crypto. The original premise still holds: when price moves far enough from its recent statistical mean, it tends to revert - and CCI quantifies that distance.
The catch is that "tends to revert" is not the same as "always reverts." CCI can stay at +200 or -300 during strong directional moves. The same trap that snares RSI and Stochastic users at their extreme bands also snares CCI users at +100 and -100.
What CCI actually measures
CCI answers one specific question: how far is the current typical price from its 20-period mean, measured in units of mean absolute deviation?
The typical price is the bar's average (high + low + close) / 3. The 20-period SMA of that typical price is the mean. The mean absolute deviation is the average of the absolute differences between each typical price and the mean over the same 20 periods.
CCI takes the current deviation and normalizes it by the mean absolute deviation, scaled by a constant (0.015) chosen so that roughly 70-80 percent of CCI readings fall between -100 and +100. Readings outside that range are "unusual" by Lambert's original definition.
Critically, CCI is unbounded. The 0.015 constant produces the +100 / -100 convention but does not cap the indicator. In strong momentum moves, CCI can reach +250, +400, or higher. Those readings mean the move is unusually large relative to recent variance - but they do not predict reversal.
The formula
Typical Price (TP) = (High + Low + Close) / 3
SMA(TP, 20) = 20-period simple moving average of TP
Mean Deviation = average of |TP_i - SMA(TP, 20)| over the last 20 bars
CCI = (TP - SMA(TP, 20)) / (0.015 × Mean Deviation)
The 0.015 constant is the calibration Lambert chose so that CCI readings between -100 and +100 capture roughly 70-80 percent of the data. The choice is arbitrary in the sense that any other constant would work mathematically; 0.015 is the convention every platform uses.
A worked example
Take a 5-period CCI for simplicity. The last 5 typical prices are:
50, 52, 51, 53, 54
Compute the SMA:
SMA = (50 + 52 + 51 + 53 + 54) / 5 = 52.00
Compute the absolute deviations from the SMA:
|50 - 52| = 2
|52 - 52| = 0
|51 - 52| = 1
|53 - 52| = 1
|54 - 52| = 2
Mean Deviation = (2 + 0 + 1 + 1 + 2) / 5 = 1.20
Current TP is 54. Compute CCI:
CCI = (54 - 52.00) / (0.015 × 1.20)
= 2.00 / 0.018
≈ 111.11
CCI reads above +100, indicating the current TP is unusually far from the recent mean. In Lambert's framework, this is a setup for mean reversion - though as noted, "unusually high" is not the same as "guaranteed to reverse."
How traders actually use CCI
Three setups work. Beyond these, CCI generates noise.
1. Mean-reversion entries in range-bound markets
The classic Lambert use. In a sideways market with no clear trend, CCI exceeding +100 suggests price is statistically stretched above its mean. A short entry on the next reversal candle, with stop above the recent high, targeting the mean (SMA(TP, 20)) provides clean mean-reversion setups.
The mirror image at -100 for longs.
This works only in range-bound markets. The "range-bound" filter is essential - applying mean-reversion logic in a trending market produces losses.
2. Divergence
Same logic as RSI / Stochastic / MACD divergence. Price prints a new high while CCI prints a lower high (or new low / higher low for bullish). High-conviction setups when confirmed by structure.
CCI divergence is somewhat noisier than RSI divergence because CCI moves further at extremes. False divergence signals are more common at +200 / -200 readings than at +100 / -100.
3. Zero-line cross as trend filter
CCI crossing above zero indicates the typical price has crossed above the 20-period mean - a textbook short-term trend filter. Below zero is the inverse.
This use ignores the +100 / -100 lines entirely. It treats CCI as a simple "above or below the mean" oscillator, similar to using a stochastic 50-line cross. Cleaner than crossover signals from +100 / -100, less noisy than DI crosses.
The trap most retail traders fall into
The standard CCI mistake: treating +100 and -100 as automatic sell and buy signals.
In a strong trend, CCI can stay above +100 for many bars. Selling each cross above +100 in a strong uptrend means shorting the trend repeatedly. The same loss pattern as the RSI 70/30 trap and the Stochastic 80/20 trap - they are all variants of the same mistake: treating an oscillator's "extreme" zone as a reversal signal in markets where momentum is dominant.
The fix is the same: require regime confirmation. CCI's extreme readings only signal mean reversion in mean-reverting markets. In trending markets, they signal continuation.
The second CCI-specific trap: getting confused by the unbounded nature. CCI can read +400 in a fast move. Traders see "+400" and think "this has to reverse" - but CCI has no upper bound, and a reading that extreme often means the move is genuinely powerful, not that it is exhausted. Extreme readings can persist or grow larger.
The third trap: using CCI without acknowledging it is essentially "deviation from mean in standard units." That is what other indicators (z-scores, Bollinger %B) measure too. CCI does not provide unique information in most cases; it provides a slightly different formulation of the same idea.
CCI vs other momentum indicators
vs RSI. RSI is bounded 0-100 and measures ratio of gains to losses. CCI is unbounded and measures deviation from the mean. RSI is more stable; CCI swings more dramatically at extremes. For mean-reversion in ranges, CCI is more responsive; for trending markets, RSI's bounded nature is less misleading.
vs Stochastic. Stochastic measures position in the recent range; CCI measures deviation from the recent mean. Different math; similar intent. Stochastic is more commonly used in retail; CCI has a smaller but devoted following, especially in commodities.
vs MACD. MACD measures the gap between two EMAs and is unbounded like CCI. The two are similar in that both can drift to extreme readings during powerful trends. Use MACD for trend confirmation, CCI for mean-reversion timing.
vs Bollinger %B. %B normalizes price's position within the Bollinger Band envelope. Conceptually similar to CCI (both measure deviation from a mean), but %B is bounded 0-1 and CCI is unbounded. %B is sometimes preferred for systematic signals; CCI for visual reads.
Common questions
Why 0.015 as the constant? Lambert chose 0.015 empirically so that 70-80 percent of CCI readings would fall between -100 and +100, calibrated against the commodity data he was working with. The choice is arbitrary in the sense that any constant would work mathematically, but 0.015 is the universal convention now.
Should I change the 20-period default? 20 is the canonical setting and reads roughly one month of trading days. Shorter periods (10, 14) make CCI noisier; longer (30, 50) smooth it. The 20 period is the consensus.
Is CCI better than RSI? Neither is strictly better. RSI is more popular and more stable; CCI swings further and is sometimes preferred for commodities and futures. The signals they generate are correlated but not identical.
Does CCI work on intraday charts? Yes, but signal quality degrades on the 1- and 5-minute timeframes. 15-minute and higher tend to produce cleaner CCI reads.
Why is CCI unbounded? Because the formula divides by mean absolute deviation, which is variable. When deviation is small (calm market) and a large move occurs, the ratio can be very large. There is no mathematical cap. Bounded oscillators sacrifice this expressiveness for ease of reading.
Can I use CCI on cryptocurrency? Yes. The math is asset-agnostic. Crypto's elevated volatility means CCI can swing further (+500, -600) than on equity markets. Calibrate the extreme thresholds upward when applying to crypto.
When to use CCI and when not to
Use CCI when:
- You are trading commodity, futures, or forex markets and want a mean-reversion oscillator
- You need an unbounded oscillator that can express the magnitude of extreme moves
- You are layering with bounded oscillators (RSI, Stochastic) for divergence confluence
Skip CCI when:
- You are in a strong trend and tempted to fade +100 / -100 readings
- You already have RSI or Stochastic doing similar work - CCI does not add much unique information
- The instrument's volatility regime is unusual (penny stocks, low-volume futures) - CCI math gets erratic in those conditions
