User login

  

 

Interpretation

CCI measures the difference between a security's price change and its average price change. High positive readings indicate that prices are well above their average, which is a show of strength. Low negative readings indicate that prices are well below their average, which is a show of weakness.

The Commodity Channel Index (CCI) can be used as either a coincident or leading indicator. As a coincident indicator, surges above +100 reflect strong price action that can signal the start of an uptrend. Plunges below -100 reflect weak price action that can signal the start of a downtrend.

As a leading indicator, chartists can look for overbought or oversold conditions that may foreshadow a mean reversion. Similarly, bullish and bearish divergences can be use to detect early momentum shifts and anticipate trend reversals.

New Trend Emerging

As noted above, the majority of CCI movement occurs between -100 and +100. A move that exceeds this range shows unusual strength or weakness that can foreshadow an extended move. Think of these levels as bullish or bearish filters. Technically, CCI favors the bulls when positive and the bears when negative. However, using a simple zero line crossovers can result in many whipsaws. Although entry points will lag more, requiring a move above +100 for a bullish signal and a move below -100 for a bearish signal reduces whipsaws.

The chart below shows Caterpillar (CAT) with 20-day CCI. There were four trend signals within a seven month period. Obviously, a 20-day CCI is not suited for long-term signals. Chartists need to use weekly or monthly charts for long-term signals. The stock peaked on 11-Jan and turned down. CCI moved below -100 on 22-January (8 days later) to signal the start of an extended move. Similarly, the stock bottomed on 8-February and CCI moved above +100 on 17-February (6 days later) to signal the start of an extended decline. CCI does not catch the exact top or bottom, but it can help filter out insignificant moves and focus on the larger trend.

Overbought/Oversold

Identifying overbought and oversold levels can be tricky with the Commodity Channel Index (CCI), or any other momentum oscillator for that matter. First, CCI is an unbound oscillator. Theoretically, there are no upside or downside limits. This makes an overbought or oversold assessment subjective. Second, securities can continue moving higher after an indicator becomes overbought. Likewise, securities can continue moving lower after an indicator becomes oversold.

The definition of overbought or oversold varies for the Commodity Channel Index (CCI). ±100 may work in a trading range, but more extreme levels are needed for other situations. ±200 is a much harder level to reach and more representative of a true extreme. Selection of overbought/oversold levels also depends on the volatility of the underlying security. The CCI range for an index ETF, such as SPY, will be usually be smaller than for a most stocks, such as Google.

Bullish Bearish Divergences

Divergences signal a potential reversal point because directional momentum does not confirm price. A bullish divergence occurs when the underlying security makes a lower low and CCI forms a higher low, which shows less downside momentum. A bearish divergence forms when the security records a higher high and CCI forms a lower high, which shows less upside momentum. Before getting too excited about divergences as great reversal indicators, note that divergences can be misleading in a strong trend. A strong uptrend can show numerous bearish divergences before a top actually materializes. Conversely, bullish divergences often after appear in extended downtrends.

Confirmation holds the key to divergences. While divergences reflect a change in momentum that can foreshadow a trend reversal, chartists should set a confirmation point for CCI or the price chart. A bearish divergence can be confirmed with a break below zero in CCI or a support break on the price chart. Conversely, a bullish divergence can be confirmed with a break above zero in CCI or a resistance break on the price chart.

Conclusions

CCI is a versatile momentum oscillator that can be used to identify overbought/oversold levels or trend reversals. The indicator becomes overbought or oversold when it reaches a relative extreme. That extreme depends on the characteristics of the underlying security and the historical range for CCI. Volatile securities are likely to require greater extremes than docile securities. Trend changes can be identified when CCI crosses a specific threshold between zero and 100.

 

Display/hide source code
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using PTLRuntime.NETScript;
using System.Drawing;
 
namespace ind
{
    //---------------------------------------------------
    // Project: Commodity Channel Index
    // Type: Indicator
    // Author: PFSoft LLC
    // Company: PFSoft LLC /www.pfsoft.com/
    // Copyright: (C) PFSoft LLC Dnepropetrovsk. Ukraine
    // Created: Nov, 28,2006
    //---------------------------------------------------
    public class CCI : NETIndicator
    {
  
        public CCI()
            : base()
        {
                ProjectName = "Commodity Channel Index";
                Comments = "Measures the position of price in relation to its moving average";
            SetIndicatorLine("line1", Color.Red, 1, LineStyle.SimpleChart);
            SeparateWindow = true;
        }
 
        [InputParameter("Type of Moving Average", 0, new object[] {
            "Simple", "SMA",
            "Exponential", "EMA",
            "Modified", "MMA",
                "Linear Weighted", "LWMA"}
        )]
        public string MAType = "SMA"; 
 
                [InputParameter("Period of Moving Average", 1)]
        public int MaPeriod = 14;
           
        public override void OnQuote()
        {
            int count = platform.BarsCount(platform.Symbol, platform.Period);
                    if(count>MaPeriod)
                    {
                        double ma = platform.iCustom(MAType, platform.Symbol, platform.Period, 0, 0, MaPeriod, ptl.TYPICAL);
                        double d = 0;
                        for (int i=0; i<MaPeriod && i<count; i++)
                        d += ptl.MathAbs(ptl.Typical[i] - ma);
 
                        d = 0.015*(d/MaPeriod);
                        if(d>0.0)
                        {
                            // Setting the value
                            platform.SetValue(0, 0, (ptl.Typical - ma)/d);
                        }
                    }
        }
    }    
}
12345

Comments