Technical / Moving Average
MACDD(short, long [, period ,offset, series])
Full Description

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.

Parameters

short: the period of the short EMA
long: the period of the long EMA
period: the period of the signal line EMA. Set this to 1 to disable it and return MACD
offset: the offset in bars; 0 is for latest values

NOTE: MACD(0) is equivalent to MACDD(12,26,1,0)

Examples

To screen for stocks that have a MACDD above 0 but were below 0 a week ago (indicating a possible recent crossover with the signal line) enter:

MACDD(12,26,9) > 0 and MACDD(12,26,9,5) < 0



Show more details