The Moving Average Convergence/Divergence oscillator (MACD) turns two trend-following indicators, moving averages, into a momentum oscillator by subtracting the longer moving average from the shorter moving average. Two functions are offered. The first is the MACD using the common defaults of 26 and 12 bars. The second allows you to specify the EMA parameters. A third parameter for a signal line changes the calculation to the difference with the signal line when set to 2 or more.
MACD(offset [, series]): the difference between a short EMA (12 bars) and a long EMA (26 bars). The MACD fluctuates above and below the zero line as the moving averages converge, cross and diverge.
MACDD(short,long [,period,offset,series]): when period is 2 or greater it returns the difference between the MACD and it's EMA (the signal line), otherwise when set to 1 (the default) it returns MACD. With this function you can specify your own long and short parameters, and the signal EMA period. Typical values are 12, 26 and 9.
MACDD(12,26,9) > 0 and MACDD(12,26,9,5) < 0