MACD Oscillator

The MACD is similar in concept to the line oscillator. In fact, the buy/sell indicators are identical. The difference is the MACD uses exponential moving averages versus the simple moving averages used in the line oscillator study.

Gerald Appel is credited with developing this study. His trading rules are simple. You buy when the oscillator crosses above the slower exponential moving average of the oscillator. Conversely, you sell when the oscillator crosses from above to below the exponential moving average of the oscillator. Lastly, divergence is possible with the MACD. The ideal signal would show divergence, clearly break a dominant trendline, and display the crossing of the MACD lines.

Another approach is to use this study in conjunction with long term charts. For example, you select the underlying weekly or monthly chart that corresponds to the intraday or daily chart for the same futures instrument. Now, you display the study on the long term chart. If the longer term chart is bullish, i.e., a buy signal is indicated, you want to be very cautious in short positions. You are trading against the longer term trend.

Computation

In this study, the oscillator is the simple difference between the first two moving averages. The formula is as follows:

OSCt = (MA1 - MA2)
OSCt is the oscillator for the current period.MA1 is the first moving average.MA2 is the second moving average.

The second part of the study computes a moving average of the oscillator. You have:

MAosct = MAosct-1+ (k * (OSCt - MAosct-1))
MAosct is the moving average of the oscillator.OSCt is the oscillator for the current interval.MAosct-1 is the moving average of the oscillator for the previous interval.k is the smoothing constant.

Since the second value, MAosct, is a moving average, it rises and falls more slowly than the oscillator. Hence, the two lines generate crossover points. These crossover points are the buy/sell signals.

If the study is displayed as a histogram, each value for the lines is calculated as:

DIFFt = OSCt - MAosct
DIFFt is the difference between the oscillator for the current interval and the moving average of the oscillator.OSCt is the oscillator for the current interval.MAosct is the moving average of the oscillator.