Moving Average Convergence-Divergence


The Moving Average Convergence-Divergence (MACD) function is based on the indicator developed by Gerald Appel. It computes the difference between a short-term and a long-term exponential moving average of the stock price. Applications of MACD include generation of buy and sell signals. Signals are generated when the MACD line crosses the zero line or its signal line.

1. Syntax

Moving Average Convergence-Divergence:


Signal Line:




2. Input

The Moving Average Convergence-Divergence functions require the following input series:

  • d0 - Input data values - The set of data values for which the MACD is calculated, usually the daily close price of a stock.

3. Parameters

The Moving Average Convergence-Divergence function has the following parameters:

  • s0 - Long Period - The larger number of time periods to use in the calculation of MACD. Default value is 26.
  • s1 - Short Period - The smaller number of time periods to use in the calculation of MACD. Default value is 12.
  • s2 - Signal Period - The number of time periods to use in the calculation of the Signal Line. Default value is 9.
  • Alignment (Optional) – Hierarchy placeholder to be used as the alignment axis.

4. Output

The MOVAVGCD function generates the following output:

  • Moving Average Convergence-Divergence - The MACD result set.

The MOVAVGCDSIG function generates the following output:

  • Signal Line - This is the result of smoothing out the MACD line via the application of an exponential moving average. The Signal Line can help to identify turns in the MACD line.

The MOVAVGCDHIST function generates the following output:

  • Histogram - The Histogram is computed as the difference between the MACD line and the Signal Line. This makes it easy to see when the two lines converge or diverge.

5. See also

Dundas Data Visualization, Inc.
400-15 Gervais Drive
Toronto, ON, Canada
M3C 1Y8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours:
Phone: 9am-6pm, ET, Mon-Fri
Email: 7am-6pm, ET, Mon-Fri