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 CCI indicator measures how far price has moved from its 20-period mean, in mean-deviation units. Above +100 is unusually high, below -100 is unusually low, and 0 is the trend line.
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.
How to read CCI at a glance
| CCI reading | Meaning | What traders do |
|---|---|---|
| Above +100 | Price is unusually far above its 20-period mean | In a range, watch for a cross back below +100 as a short setup. In a trend, treat it as momentum, not a sell signal |
| -100 to +100 | Price is within its normal range around the mean | No extreme signal. Use the zero line for trend direction |
| Below -100 | Price is unusually far below its 20-period mean | In a range, watch for a cross back above -100 as a long setup. In a trend, treat it as momentum, not a buy signal |
| Cross above or below 0 | Typical price crossed its 20-period mean | Above 0 is short-term trend up, below 0 is short-term trend down |
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 bars are:
| Bar | High | Low | Close | Typical price |
|---|---|---|---|---|
| 1 | 51 | 49 | 50 | 50 |
| 2 | 53 | 51 | 52 | 52 |
| 3 | 52 | 50 | 51 | 51 |
| 4 | 54 | 52 | 53 | 53 |
| 5 | 55 | 53 | 54 | 54 |
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."
The standard 20-period CCI uses 20 typical prices, not 5. The 5-period version here is for teaching only - it makes the arithmetic visible. The formula is identical; only the count of bars changes.
CCI Calculator
Enter five bars of high, low, and close. CCI is (last typical price - SMA of typical prices) / (0.015 x mean deviation). The standard 20-period CCI uses 20 bars; this 5-bar version is for teaching only.
| Bar | Typical price | |TP - SMA| |
|---|---|---|
| 1 | 50.00 | 2.00 |
| 2 | 52.00 | 0.00 |
| 3 | 51.00 | 1.00 |
| 4 | 53.00 | 1.00 |
| 5 | 54.00 | 2.00 |
Best CCI settings and how to add it
| Setting | Best for |
|---|---|
| 9-12 | Day trading, faster signals, more noise |
| 14 | MT4 and MT5 default, the most common short setting |
| 20 | Lambert's original, the standard for daily charts |
| 30-50 | Swing trading, smoother signals, fewer trades |
Note the default difference: TradingView defaults to 20, the Lambert original. MT4 and MT5 default to 14. The same chart can look different on the two platforms for that reason alone - check the period before comparing readings.
How to add CCI in TradingView
- Open the chart and click Indicators.
- Search for "Commodity Channel Index" and click it.
- Leave the length at 20 for the standard setting, or change it to match the table above.
- The +100, -100, and zero lines are drawn by default. No other settings need to change.
How to add CCI in MT4 and MT5
- Open the Navigator and expand Indicators, then Oscillators.
- Double-click "Commodity Channel Index".
- Set the period to 14 for the platform default, or 20 for Lambert's original.
- Click OK. The indicator appears in a sub-window below the chart, with +100 and -100 levels marked.
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.
Entry: short when CCI crosses back below +100 after exceeding it, on the next reversal candle. Long when CCI crosses back above -100 after dropping below it. Stop: above the recent high for a short, below the recent low for a long. Exit: at the 20-period SMA of typical price, the mean CCI is measuring from.
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.
Entry: short on the break of the prior swing low after bearish divergence prints, or long on the break of the prior swing high after bullish divergence. Stop: above the price high that made the divergence for a short, below the price low for a long. Exit: at the 20-period SMA of typical price, or when CCI crosses the zero line in your favour.
Example, EUR/USD 4-hour chart: price makes a higher high at 1.0880 after an earlier high at 1.0850, while CCI makes a lower high, 98 against 142 at the earlier high. The short entry is the break of the prior 4-hour swing low, with the stop above 1.0880 and the exit at the 20-period SMA of typical price. The divergence warns that the second push up had less momentum behind it than the first.
The same chart shows the other side of divergence. In a strong uptrend CCI can stay above +100 for many bars while price keeps making higher highs. Fading every +100 reading in that trend means shorting into momentum, and each short loses. Divergence only works when the trend is actually weakening - confirm with price structure breaking down before taking the trade.
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.
Entry: long on the close of the bar where CCI crosses above zero, short on the close where it crosses below zero. Stop: below the recent swing low for a long, above the recent swing high for a short. Exit: when CCI crosses back below zero for a long, or back above zero for a short.
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.
Pros and cons of CCI
| Pros | Cons |
|---|---|
| Measures exactly how stretched price is from its mean | Unbounded readings can mislead - +400 does not mean reversal |
| More responsive than RSI at extremes, useful in ranges | Noisier than RSI, more false signals at extremes |
| Zero-line cross is a clean, simple trend filter | Fading +100 / -100 in a trend loses repeatedly |
| Works on any asset: stocks, futures, forex, crypto | Adds little unique information over RSI, Stochastic, or Bollinger %B |
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
