The MACD is one of the best-known indicators, or more precisely, centered oscillators. It is used in a variety of ways by many traders. A popular way of using the MACD is to trade the moving average crossover of MACD above its 9 day EMA. As this setup is so widely popular I’ve often wondered how well it works, partially due to my natural skepticism but also because if it works, perhaps there is a system that can be built using it.
Testing the MACD
Entry: Buy the close if the difference between the 12 and 26 day exponential moving average (MACD) has crossed above its own 9 day EMA.
Exit: A time exit between 1-20 days will be used, with the trades being executed at the close.
How do we know if it works?
The 1 day and 20 day rate-of-change will be compared with the baseline data. Also, I may work up a simple test with money management rules to see the system drawdown and equity curve.
When I backtest ideas, I like to be sure that I am testing them in a way that can be re-created in real-life trading. It bothers me that there can be bullish MACD crosses when the cross barely registers, because if one were trying to recreate this trade in real-time, it would probably be impossible to know for sure if the cross was going to happen in time to get the order filled. Therefore, I calculated the difference between the MACD and Signal and required the result be above a minimum threshold.
Requiring the threshold performs two functions in the testing. The first is that it helps to make it more possible for the trade to be replicated in real life. Secondly, we can evaluate the results to see if they are improved by requiring a strong MACD bullish crossover.
Four separate tests were run. One test did not use a threshold, and the 3 others tested thresholds of .01, .03, and .05 A threshold of .01 is very small, and as represented in the histogram of a typical MACD graph, may even be imperceptible unless the graph is magnified.
I am also including below 4 graphs, each showing the average ROC, from 1-20 days out, following a positive MACD cross. Pay careful attention to how the threshold criteria affects the ROC.
1985 – 9/09/2009
Results: 1990-1999 (Bullish Period)
Results: 2000 – 9/9/09 (Bearish Period)
MACD can provide a slight edge on the day after the cross. Even during the bearish period when a bullish MACD cross did not work well at all, the day after the cross provided almost double the average one-day return.
Adding the threshold requirement puts an interesting twist on the MACD cross, at least in my opinion.
Almost without exception, a strong MACD cross (one that closes with the histogram greater than .05) results in a period of negative, or lowered expectancy.
Over a longer period, as measured by the 20 day rate-of-change, a MACD cross is often much worse than a random entry.
More than anything, these MACD studies show that for the better part of 10 years, the universe of stocks has been subject to a strong tendency to mean-revert. Likely the best way to use the MACD is to filter for a reading that is very extended above/below the zero line, and then short/buy the stock, expecting a reversal to the mean.
Comments, concerns, and criticism on this research is welcome, as always.
I included the above chart to show just how small a cross of .05 is, in comparison to how much it affects future returns.