Measures how far the current typical price has deviated from its statistical average over a lookback window, scaled so ~70-80% of values fall between −100 and +100. Unbounded — extreme readings (±200 and beyond) flag genuinely unusual conditions.
CCI(20) on MES 5m with extreme spikes visible
What it measures
- Statistical deviation. How many "mean deviations" the current typical price is from its SMA. Roughly analogous to a z-score, but using mean absolute deviation instead of standard deviation.
- Momentum strength. Magnitude of CCI tells you how decisively price has broken from the average.
- Cyclical position. Best known for identifying cyclical extremes in commodities (its original use case) but works on any instrument with reasonable mean-reverting tendencies.
Formula
How AlgoLift computes it
TP = (High + Low + Close) / 3 (Typical Price)
MA = SMA(TP, period)
MD = mean( |TP[i] − MA| ) over the same period (Mean Deviation)
CCI = (TP − MA) / (constant × MD)
The default constant is 0.015. This scaling factor was chosen empirically by Donald Lambert (the indicator's developer in 1980) so that roughly 70–80% of historical CCI values fell between −100 and +100. Different constants change the spread of values without changing the underlying signal.
Inputs in AlgoLift
| Setting | Default | Range | Notes |
|---|---|---|---|
| Period | 20 | 2–500 | Lookback for the SMA and mean deviation. |
| Constant | 0.015 | 0.001–0.1 | Scaling factor. Leave at default unless you have a specific reason. |
Recommended periods
- 14: Faster cyclical detection. More signals, more whipsaws.
- 20 (default): Standard. Good for swing and intraday.
- 30–50: Smoother readings for longer-horizon trades.
Outputs in AlgoLift
| Handle | Type | Plotted | Notes |
|---|---|---|---|
| CCI Value | Numeric | Always | The oscillator. Unbounded. |
| Slope | Numeric | On select | Rate of change — useful for divergences and turn detection. |
| Mean Deviation | Numeric | On select | The denominator. A pure volatility measure on its own. |
CCI node — default state with all three outputs
How to read it
- CCI > +100: Strong upside momentum or overextended price. Both interpretations are valid depending on regime.
- CCI < −100: Strong downside momentum or oversold conditions.
- CCI > +200: Genuinely extreme — historically rare. Often precedes a pullback even in trending markets.
- CCI < −200: Genuinely extreme on the downside.
- CCI crossing zero: A shift from below-average to above-average price (or vice versa). Often used as a trend filter.
The ambiguity at ±100 — "strength" or "extreme" — is why CCI works differently in trends vs. ranges. Always pair with a regime context.
CCI above +100 is either momentum confirmation (in trends) or a reversal warning (in ranges). Without a regime filter telling you which, the same reading produces opposite signals.
Best in / worst in
Best in instruments with clear cyclical behavior (commodities, FX), markets with measurable mean-reverting tendencies, and as a confirmation tool alongside trend filters.
Worst in instruments with persistent one-way drifts (some equity indices during multi-year bull runs) where CCI stays positive almost continuously, and during high-volatility news events that produce extreme readings that don't reverse cleanly.
Three setups
1. CCI breakout — momentum confirmation
In trending markets, use CCI crossing +100/−100 as a momentum-confirmation entry.
- Long: CCI crosses above +100 AND price > EMA(50).
- Short: CCI crosses below −100 AND price < EMA(50).
The trend filter is essential — without it, this strategy buys tops and sells bottoms in ranges.
CCI breakout entry filtered by EMA(50) trend
2. CCI extreme reversion in ranges
In range-bound markets, use CCI extreme readings as mean-reversion entries.
- Long: CCI < −200 AND CCI slope > 0 (turning back up) AND KAMA Efficiency Ratio < 0.3 (range regime).
- Short: Symmetric.
The ER filter prevents this setup from firing in trends where CCI < −200 just means strong downside momentum.
3. Zero-line filter for an independent strategy
Use CCI's zero-line cross as a trend filter for another signal generator.
- Long-only mode: CCI > 0 — the strategy is permitted to take long entries (from RSI, MACD, etc.).
- Short-only mode: CCI < 0.
- Flat: CCI between −20 and +20.
A simple, effective regime gate that runs in parallel with the main strategy.
Advanced patterns in AlgoLift
CCI divergence with BarsAgo Modifier. Compare current CCI against its value 10 bars ago, and current price against price 10 bars ago. When they disagree directionally (price higher, CCI lower — or vice versa), divergence is real. Use as a contrarian entry trigger in range regimes.
CCI-driven scale-in. Use the initial signal (any entry trigger) to take a starter position. Then use a Scaled Entry that fires when CCI crosses ±200 in the trade's direction — momentum confirmation that the move has continued. Adds to winners while avoiding adds to fakeouts.
Multi-timeframe CCI for regime filtering. Use CCI(20) on a daily timeframe as a long-horizon momentum filter alongside your 5m execution chart. Only take 5m entries when daily CCI is in the corresponding direction (positive for longs, negative for shorts). See the multi-series Visual Builder pattern.
Common mistakes
- Treating ±100 as universal reversal thresholds. ±100 means different things in different regimes. In a trend, +100 is confirmation. In a range, +100 might be a top.
- Using CCI as a primary signal without a trend filter. The most common CCI mistake. Always combine with a regime indicator.
- Tuning the Constant. It's an empirical scaling factor with no information content. Tuning it just rescales the same signal. Leave it at 0.015.
- Ignoring the Mean Deviation output. It's a pure volatility reading available for free. Useful in its own right as a regime classifier.