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.
Moving Average Convergence-Divergence:
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.
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.
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.