Cci Calculator
Calculate the Commodity Channel Index for identifying cyclical trends and extreme price levels.
Formula
CCI = (TP - SMA(TP)) / (0.015 x Mean Deviation)
Where TP = (High + Low + Close) / 3, SMA(TP) is the Simple Moving Average of Typical Prices over N periods, and Mean Deviation is the average of absolute differences between each TP and the SMA. The 0.015 constant normalizes readings so ~75% fall between -100 and +100.
Worked Examples
Example 1: CCI Calculation Example
Problem: For a 20-period CCI, the current Typical Price is 157.67, the 20-period SMA of TP is 155.50, and the Mean Deviation is 2.80. Calculate CCI.
Solution: CCI = (Typical Price - SMA of TP) / (0.015 x Mean Deviation)\nCCI = (157.67 - 155.50) / (0.015 x 2.80)\nCCI = 2.17 / 0.042\nCCI = 51.67\nInterpretation: CCI at 51.67 is between 0 and +100\nThis indicates bullish momentum but not yet at extreme levels\nPrice is above average but within normal range
Result: CCI = 51.67 | Bullish Momentum | Price above average but within normal +/-100 range
Example 2: CCI Trend Signal
Problem: CCI crosses above +100 from 95 to 115. The 50-period moving average is sloping upward. The previous CCI reading was 95. Evaluate the signal.
Solution: CCI crossing above +100 = New uptrend initiation signal\nMoving average sloping up = Confirms bullish trend\nCCI moved from 95 to 115 = Momentum accelerating\nLambert strategy: Enter long when CCI crosses +100\nExit when CCI falls back below +100\nStop loss: Below recent swing low or at -100 CCI level\nConfirmation: Volume should expand on the breakout
Result: Strong Buy Signal | CCI above +100 with trending MA | New uptrend beginning
Frequently Asked Questions
What is the Commodity Channel Index (CCI) and what does it measure?
The Commodity Channel Index (CCI) is a versatile momentum oscillator developed by Donald Lambert in 1980 that measures the deviation of the current typical price from its average over a specified period. Despite its name, CCI works on any financial instrument including stocks, forex, and cryptocurrencies, not just commodities. The indicator oscillates around a zero line, with readings above +100 traditionally indicating an overbought condition or the start of a new uptrend, and readings below -100 indicating an oversold condition or the start of a new downtrend. CCI is unique because approximately 75 percent of readings fall between +100 and -100, making moves beyond these levels statistically significant.
How is the CCI formula calculated step by step?
The CCI calculation involves four steps. First, calculate the Typical Price (TP) for each period as (High + Low + Close) / 3. Second, calculate the Simple Moving Average (SMA) of the Typical Prices over the lookback period (typically 20). Third, calculate the Mean Deviation by finding the average of the absolute differences between each Typical Price and the SMA. Fourth, apply the CCI formula: CCI = (Current TP - SMA of TP) / (0.015 x Mean Deviation). The constant 0.015 was chosen by Lambert to ensure that approximately 70 to 80 percent of CCI values fall between -100 and +100 when the price follows a normal distribution. This normalization makes it easy to identify unusual price movements.
What do CCI readings above +100 and below -100 signify?
CCI readings above +100 indicate that the typical price is significantly above its average, suggesting strong bullish momentum that could signal the beginning of a new uptrend. This is not simply an overbought signal, as in strongly trending markets, CCI can remain above +100 for extended periods. Readings below -100 indicate that the typical price is well below its average, suggesting strong bearish momentum or the start of a downtrend. Lambert originally designed the indicator to identify new trends when CCI crossed above +100 or below -100. The zero line crossing also provides signals, with crosses above zero suggesting bullish momentum is gaining and below zero indicating bearish momentum. Extremely high or low readings may also precede reversals.
What is the best period setting for CCI?
The standard CCI period is 20, which was the default recommended by its creator Donald Lambert. This setting works well for daily charts in most markets, capturing approximately one month of trading data. Shorter periods like 10 or 14 make CCI more responsive to price changes, generating more frequent signals that are useful for short-term trading and scalping. However, shorter periods also produce more false signals and noise. Longer periods like 40 or 50 create smoother CCI readings suitable for swing trading and position trading, with fewer but higher quality signals. For intraday trading, 14 or 20 periods on 15-minute or hourly charts provide a good balance. Many traders use multiple CCI periods simultaneously for confirmation, such as a 14-period CCI for timing and a 50-period CCI for trend direction.
How do you trade CCI divergences?
CCI divergences are powerful reversal signals that occur when price and CCI move in opposite directions. Bullish divergence happens when price makes a lower low while CCI makes a higher low, indicating that selling momentum is weakening despite lower prices. This often occurs near the end of downtrends and suggests a reversal to the upside. Bearish divergence occurs when price makes a higher high but CCI makes a lower high, suggesting that buying momentum is fading even as price reaches new highs. For best results, divergences should form when CCI is in or near extreme territory (above +100 or below -100). Confirm divergence signals with a price action trigger such as a reversal candle pattern, a trendline break, or a support/resistance level. Multiple divergence peaks or troughs increase the reliability of the signal.
How does the 0.015 constant in the CCI formula work?
The constant 0.015 in the CCI formula is a scaling factor that Lambert specifically chose to normalize the indicator readings so that approximately 70 to 80 percent of CCI values fall between -100 and +100 under normal market conditions. Without this constant, the raw ratio of price deviation to mean deviation would produce values that are difficult to interpret consistently across different instruments with varying price levels and volatilities. The constant ensures that readings beyond the plus or minus 100 threshold are statistically unusual, representing price movements that deviate significantly from the norm. This normalization makes it possible to compare CCI readings across different markets, timeframes, and price levels using the same overbought and oversold thresholds of plus 100 and minus 100.