Price moves in trends. Trends can be extremely short-term, down to the tick level, or month-long steady climbs (or falls) in a stock’s value. The tools we use to predict or detect these trends are as varied as the time frames on which they appear. As you would expect, some tools are more appropriate for certain time frames than others.

Trendlines are one of the simpler tools. These basic lines, drawn roughly along price lows to indicate support in uptrends or along price highs to indicate resistance in downtrends, identify general market price direction. They provide excellent guidance during clean and persistent price trends.

However, such qualities are not always in place. Often, trends play out in fits and starts, surging ahead only to give back several points before resuming the move in the predominant direction. For these moves, it is more difficult to see where price is headed. We need to turn to a tool that is more sensitive to price changes that are inconsistent over time.

The commodity channel index (CCI) is an oscillator designed to be effective in these environments. Don’t be confused by the use of the word “commodity” in the name. This oscillator, popularized by Donald Lambert, works perfectly well on stocks. It measures the variation of a security’s price from its statistical mean. This variation can hold clues to a change in price trend.

Lambert’s basic assumption is that tradable assets, such as stocks and commodities, move in cycles. CCI helps by indicating when an asset has moved too far above its mean for the trend to sustain (overbought condition), or has become too cheap for sellers to maintain necessary selling pressure (oversold condition). These levels can, in turn, be used to generate buy and sell signals against the recent move.

**CCI calculation**

There are four steps in the calculation of the CCI:

- Calculate the typical price (TP). Add each period’s high, low and close and divide by three: TP = (H+L+C)/3
- Calculate the n-period simple moving average of the typical price (SMATP). Traders generally use a 20-period SMA because on average there are 20 trading days in a month.
- Calculate the mean deviation (MD). First, calculate the absolute value of the difference between the last period’s SMATP and the typical price for each of the past 20 periods. Add all of these absolute values together and divide by 20 to find the mean deviation.
- The final step is to apply the TP, the SMATP, the MD and a constant (0.015) to the following formula: CCI = (TP – SMA) / 0.015 x MD

There are three basic applications of the CCI indicator in trading:

- Zero-line crossover
- Overbought and oversold levels
- Trading divergence (positive and negative)

We’ll discuss each of the above methods in detail, elaborating with examples.