Rounding out my trilogy of technical indicators, I decided to go back to look at momentum strategies since the supposed “reversal” strategies that I was testing turned out to be “momentum-plus” strategies anyway. An old favorite of my professor is the MACD, who would have liked this theoretical take:
Results
There are 3 sets of trading rules that use MACD. The first is the “signal crossover”, the second is the “zero line crossover”, and the third is “divergence”. Of these, the first two are momentum indicators and the last is a reversion indicator. I was able to successfully program the first two but failed to generate any trading signals in all permutations of the last – this could be a result of my only using daily close prices. In any rate, here are the results of varying the degrees of freedom on the first two tests:
Rule 1 – Signal line crossover
Rule 2 – Zero line crossover
Pretty excellent stuff; even the short rule makes money.
Here is the summary stats:

We see that the “zero line crossover” strategy compounds money at an astounding 18.3% every year. However the common thing about these MACD strategies is that they suffer incredibly long drawdowns (252 is one year, so for example the Normal Long And Short 2 strategy suffered a 60.2% drawdown for almost 8 years – by comparison, the best Bollinger Band strategy gave a 17% CAGR for a drawdown of under 3 years) that I personally cannot really live with. However the high return bears consideration, so the MACD may have use as part of a “combined” trading strategy (I intend to backtest the combination of the “trilogy” of indicators in a future post).
In signal processing terms, the MACD is a filtered measure of velocity. The velocity has been passed through two first-order linear low pass filters. The “signal line” is that resulting velocity, filtered again. The difference between those two, the histogram, is a measure of the acceleration, with all three filters applied. An MACD crossover of the signal line indicates that the direction of the acceleration is changing. The MACD line crossing zero suggests that the average velocity is changing direction.I created a generalized MACD trading program that has the usual degrees of freedom I imposed on the other programs I have done. Of interest was the entry/exit rules, for which I used that wiki entry and this page as my guide.
Results
There are 3 sets of trading rules that use MACD. The first is the “signal crossover”, the second is the “zero line crossover”, and the third is “divergence”. Of these, the first two are momentum indicators and the last is a reversion indicator. I was able to successfully program the first two but failed to generate any trading signals in all permutations of the last – this could be a result of my only using daily close prices. In any rate, here are the results of varying the degrees of freedom on the first two tests:
Rule 1 – Signal line crossover

Rule 2 – Zero line crossover
Pretty excellent stuff; even the short rule makes money.Here is the summary stats:

We see that the “zero line crossover” strategy compounds money at an astounding 18.3% every year. However the common thing about these MACD strategies is that they suffer incredibly long drawdowns (252 is one year, so for example the Normal Long And Short 2 strategy suffered a 60.2% drawdown for almost 8 years – by comparison, the best Bollinger Band strategy gave a 17% CAGR for a drawdown of under 3 years) that I personally cannot really live with. However the high return bears consideration, so the MACD may have use as part of a “combined” trading strategy (I intend to backtest the combination of the “trilogy” of indicators in a future post).
No comments:
Post a Comment