[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MACD periods, QP scans



PureBytes Links

Trading Reference Links

In a message dated 11/25/98 4:55:40 PM Pacific Standard Time, jgelfand@xxxxxxx
writes:

> The canned MACD is MS is
>  actually the true MACD equation but most people use the version of the
>  equation below (i.e. the QP2 version)?

Hi, Ed: The canned version -- MACD() -- calculates the exponential moving
averages by using percentages, not time periods. The help file says: 

MACD is "calculated by subtracting the value of a 0.075 (26-period)
exponential moving average from a 0.15 (12-period) exponential moving average.
A 9-period dotted exponential moving average (the "signal line") is
automatically displayed on top of the MACD indicator line."

You can read more about how an exponential moving is calculated in "Technical
Analysis from A to Z," by Steven Achelis. Achelis writes: "Because most
investors feel more comfortable working with time periods rather than with
percentages, the exponential percentage can be converted into an approximate
number of days. For example, a 9 percent moving average is equal to a 21.2
time-period (rounded to 21) exponential moving average."

The Metastock help file explains why Metastock uses the percentage
calculation:

"In order to maintain the mathematical integrity of the MACD as prescribed by
Gerald Appel, MetaStock does not allow the time periods in the MACD to be
changed.  The MACD is actually the difference between   0.075 and 0.15
exponential moving averages.  No exact time periods (using whole numbers)
correspond with these percentages.  If you want to plot an MACD-like indicator
using moving averages other than the ones recommended by Gerald Appel, use the
Price Oscillator (see Price Channel)."

The problem is that you're limited to MACD (12,26) with the formula that
"maintains the mathematical integrity" of Appel's MACD. To use other periods,
you're going to have to use the Price Oscillator or the custom formula I sent
in a previous note:

period1:=13;
period2:=34;
period3:=89;
Mov(C,period1,E) - Mov(C,period2,E);

The custom formula amounts to the same thing as the Price Oscillator (and
gives identical values) when you use an exponential moving average with both. 

When you use MACD, you're going to have your own preferences for periods --
for example (5,35,4) or (8,17,9). You're going to need the custom formula (or
the Price Oscillator).

Metastock made Appel's original formula available, with Appel's periods (12,
26). But it also makes it possible to use your own periods, with the Price
Oscillator or the custom formula. The custom formula isn't just something
people make do with -- it's the traditional formula for MACD and is available
at the Metastock formula site:

http://www.equis.com/customer/support/formulas/cf00057.html

Note the formula for the MACD histogram at the site:

( Mov( C,12,E ) - Mov( C,26,E ) ) - Mov( ( Mov( C,12,E ) - Mov( C,26,E ) ),9,E
) 

That's the custom formula for the historgram I gave you. It's just the MACD
minus the signal line. 

So this is the formula that's most useful for MACD (when you substitute your
own periods):

( Mov( C,12,E ) - Mov( C,26,E ) )

And this is the signal line:

Mov( ( Mov( C,12,E ) - Mov( C,26,E ) ),9,E ) 

And this is the histogram:

( Mov( C,12,E ) - Mov( C,26,E ) ) - Mov( ( Mov( C,12,E ) - Mov( C,26,E ) ),9,E
) 

You'll get the same values as you do in QP if you use those formulas. And you
can change the periods, as you can in QP. 

If you're studying Appel and trying to reproduce his results, you can use this
canned formula: MACD(). But you can't change the periods. I don't even use the
periods in that formula (12,26) -- and I don't use the canned formula. 

I hope this helps. You can delve further into the subject by reading about
exponential moving averages and how to convert exponential percentage into an
approximate number of days. (It might make interesting conversation at the
dinner table tomorrow.)

Brooke