Before you begin: Understand an SMA, absolute values and high/low/close inputs.
Calculate typical price and mean absolute deviation
Distinguish CCI from a z-score
Handle zero-deviation windows
Mechanism and interpretation
CCI compares current typical price with its window average, scaled by mean absolute deviation and a conventional constant. Typical price is(high+low+close)/3. For the selected window, compute the average typical price, then average the absolute distances of each typical price from that same window mean. CCI=(current typical price−window mean)/(0.015×mean absolute deviation). Mean absolute deviation is not standard deviation: it averages absolute differences rather than squared differences followed by a square root.
The resulting oscillator is not bounded to 0–100. A reading above 100 describes an above-average price relative to the chosen deviation scale; it is not a probability, a percentage return or a guaranteed reversal. The 0.015 factor scales the output but does not impose a universal empirical coverage percentage on every instrument and regime. Window length and price input affect which observations appear extreme.
Worked case — synthetic data
Synthetic typical prices are 10,12,14. Their mean is 12. Absolute deviations are 2,0,2, so mean deviation is 4/3. Current deviation is 14−12=2. Denominator is 0.015×4/3=0.02, giving CCI 100. If standard deviation were mistakenly substituted, population deviation would be sqrt(8/3)≈1.633 and the output about 81.65, a different indicator despite similar-looking algebra.
Now suppose a longer-window calculation has current typical price 106, window mean 100 and mean absolute deviation 2. Its CCI is 6/(0.015×2)=200. This does not mean the next return is−200% or that the price is twice intrinsic value. It states that current deviation is large under the selected scaling. A trend can maintain large positive values while advancing further.
Context and failure modes
When every typical price in the window is identical, mean deviation is zero and the formula is undefined. State whether the implementation emits a missing value, a neutral convention or another documented result. Do not silently divide by a tiny replacement number and interpret the resulting extreme as a meaningful signal. Adjusted and unadjusted prices must not be mixed across corporate events.
Practice task
Typical prices are 20,22,24. Compute the mean, mean absolute deviation and final CCI under the same three-observation convention. Then explain why changing all prices by adding 100 does not change CCI.
Worked practice answer
Mean is 22, mean deviation 4/3 and current deviation 2, so CCI is 100. Adding 100 shifts both each price and the mean equally, leaving all differences and their scale unchanged. The indicator is translation-invariant under this arithmetic, although market context may differ.
Topic assessment
Choose an answer before opening each explanation. These questions test the specific mechanism in this lesson.
1. Which dispersion measure belongs in this CCI formula?
Standard deviation automatically
Current high minus low only
Mean absolute deviation from the window mean
Reveal answer and explanation
C. The denominator averages absolute deviations, not squared deviations.
2. Is CCI bounded at 100?
No
Yes
Only for positive prices
Reveal answer and explanation
A. The 100 level is a convention, not a mathematical maximum.
3. What must be handled in a constant-price window?
A missing company name
A zero mean-deviation denominator
Infinite actual trading volume
Reveal answer and explanation
B. The raw formula cannot produce a valid ratio from zero divided by zero.
Primary references and scope
Original explanation and synthetic calculations. Chart thresholds are explicit research conventions, not exchange rules or proof of predictive ability.