Commodity Channel Index
By LuxAlgoApr 13, 2020
The Commodity Channel Index gauges how far the typical price has drifted from its own average. Donald Lambert's formula subtracts an n-period simple moving average from the source and divides by 0.015 times the mean absolute deviation, a scaling chosen so most readings land between +100 and -100 — the oscillator itself is unbounded, and strong trends push it past those levels. Defaults are a length of 20 computed on the hlc3 typical price, and the build is the standard raw implementation of Lambert's CCI, plotted with upper, lower, and zero reference lines.
How to Trade the Commodity Channel Index?
- CCI crossing above the Upper Level (+100): unusual stretch above the average — Lambert's original reading joins it as strength, exiting when CCI drops back below the level.
- CCI crossing below the Lower Level (-100): the downside equivalent — trend strength to momentum traders, oversold stretch to mean-reversion traders.
- Fading extremes in ranges: in demonstrably range-bound tape, excursions beyond the levels are commonly faded back toward zero. Join-the-strength and fade-the-stretch point opposite ways on the same line, and CCI cannot arbitrate — establish whether the market is trending or ranging first.
Commodity Channel Index Settings
- Length (default 20): the window for both the moving average and the mean absolute deviation. Shorter lengths make level visits frequent and shallow; longer ones make them rarer and more meaningful.
- Source (default hlc3): the price series measured; the hlc3 typical price is Lambert's classic input.
- Upper Level (default 100): the overbought reference; pushing it higher isolates severe stretch.
- Lower Level (default -100): the oversold mirror.
Alerts
Three alert conditions are included: Cross Above +100 and Cross Below -100, firing at the configured upper and lower levels, plus Zero Line Cross for zero crossings in either direction.
Frequently Asked Questions
Is a CCI reading above +100 bullish or bearish?
Both traditions exist: Lambert's rules bought the cross above +100, while later practice often fades the same excursion as overbought. Extremes extend in trends and revert in ranges, so let a regime read decide.
How does CCI differ from RSI?
RSI is bounded 0 to 100 and built from smoothed gains versus losses; CCI is unbounded, built from price's distance to its average normalized by typical deviation. One grades how unusual the stretch is; the other how one-sided closes have been.
What length should I use for CCI?
The default of 20 is the common modern choice, with 14 a frequent faster alternative. Shorter windows produce more, noisier threshold events — tune frequency to your holding period.
Free indicator
Get free access to this indicator on the platforms below.
The Library is free. Quant makes it yours.
Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.
