Commodity Channel Index Calculation

The Commodity Channel Index (CCI) is an oscillator that helps to identify overbought and oversold conditions. This means that at the top of an uptrend (or the bottom of a downtrend), the Commodity Channel Index aims to provide a sell signal (or buy signal) that alerts the trader to a trend reversal. It accomplishes this by calculating the “typical price,” subtracting the simple moving average of the typical price, then dividing the result by the mean deviation and a constant.

Commodity Channel Index Calculation

The typical price for a given period is calculated by adding the high, low, and close prices together, then dividing that sum by 3. This is a simplistic way to determine a single price for each period, though other methods such as volume weighted average price are certainly possible. The simple moving average of the typical price is, by default, calculated over the last 20 periods, though this is configurable and should vary depending on the market and time period. The mean deviation is a complex way of stating the average distance each of the last 20 periods are from the moving average.

Commodity Channel Index Example

CCI values in dark red represent overbought conditions while values in dark green represent oversold conditions.

To illustrate this, see the table above. This data set shows an imaginary market that moves back and forth between 95 and 105 in increments of 1. This results in a 20-period simple moving average that is always equal to 100. The mean deviation is then very easy to calculate: each period’s deviation is just that period’s price minus 100. Since we don’t care about whether this number is positive or negative (99 is just as far from 100 as 101), we take the absolute value of each distance (deviation), then calculate the average (mean) for the last 20 periods. Our hypothetical data set produces a consistent mean deviation of 2.5 over any 20 period span. We now have an ideal market for the Commodity Channel Index with our range-bound, mean-reverting market.

 

CCI Practical Application

You may notice, however, that the CCI isn’t particularly useful in this scenario. We don’t need an indicator if we already know the top and bottom of the range. If we were to overlay the price and CCI we would see that they have nearly identical shapes. The usefulness of the CCI comes to light in real world applications, when noise begins to distort the price action. The daily crude oil chart below shows a 50 day moving average in blue and a 20 day CCI in green. The arrows on the chart point to days when the CCI crosses up over -100 or down below +100. These arrows represent buy and sell signals (up and down arrows) based on just one interpretation of the indicator. Crossovers from normal ranges into overbought/oversold zones, reversals in CCI direction, and studies on CCI movement itself can produce signals as well.

Commodity Channel Index on Daily Crude Oil Chart

50 day simple moving average and 20 day CCI on a daily crude oil chart. Blue arrows represent possible buy (up arrow) and sell (down arrow) signals generated by the CCI.

The signals produced in our chart do a reasonably good job of indicating relative highs and lows, but they aren’t without fault. Note that waiting for the CCI to cross back over +/-100 allows for better confirmation of a reversal, but at the cost of entering the trade at least one bar late. Do your research and test different time periods and interpretations of the CCI before placing live trades.

The Commodity Channel Index, like all other indicators, must be used with caution. A market that trades sideways is a good candidate for the CCI, while a market that continues in an up or down trend for extended periods of time will tend to produce false signals. Use other indicators and studies as well as price and volume action to verify signals produced with the Commodity Channel Index.

 

Learn More

To add and configure the Commodity Channel Index to your CTS charts, please refer to our wiki guide for adding a study and configuring the CCI.
To register for a free trial of the CTS simulator, please follow this link to the sim registration page.
For a list of CTS features and our platform pricing calculator, please see our pricing page.