**Introduction to the MACD and the Data**

The MACD, the Moving-Average Convergence Divergence indicator, has been around for more than 45 years. It is a collection of three time series usually calculated from the closing prices of a security. The two lines that ultimately result from them are the difference between the 26-day exponential moving average and the 12-day EMA (called MACD), as well as a 9-day EMA of the MACD itself (signal line). When the MACD (yellow line in the chart below) crosses above the signal line (blue line), it is considered a buy signal and if the other way around, it is a sell signal. Typical periods for which these signals are generated are weeks and months.

In this article, I test the appeal of the MACD based on the S&P 500 since 2000. The dataset includes the daily closing prices of the S&P 500 (NYSEARCA:SPY) from January 2000 until 1/11/2017. The backtest logic is straightforward, namely that if the MACD indicator gives us a buy signal, we go long the index, if it gives us a sell signal, we stay flat.

**Results based on daily closing prices**

Using the standard 12-26-9 setting, we get the following result:

The standard MACD strategy based on the S&P 500 has, even before costs, underperformed significantly. The return is 0.9% p.a. at a standard deviation of 11.9%, giving a Sharpe ratio of 0.07. That compares with the S&P 500 in the sense that the S&P 500 has had an annualized return of 3.14% and a standard deviation of 19.7% (Sharpe 0.16) since 2000. As such, the strategy does reduce volatility but the return is abysmally worse. Even at this point we can say you'd be better off investing in money market funds than following the standard MACD strategy on the S&P 500.

**Inverse MACD**

If we invert the MACD logic and stay flat when the MACD gives a buy signal, and go long when the MACD gives a sell signal, we get the following picture:

As you can see, the results are much better, but the drawdowns are higher, too. In this case, we have an annualized return of 2.24% at a standard deviation of 15.73%. Still, both strategies trail the S&P 500, which is especially worrisome since the standard MACD is widely-used and oftentimes employed in an attempt to "beat the market".

Below, you find the overview over the backtest:

**Results based on weekly closing prices**

Similar to moving average strategies, we might get an interesting strategy if we stretch the time frame to weekly to reduce noise and false signals. The typical period for which signals are generated is then usually several months. Applying the standard MACD over the weekly S&P 500, we get the following results:

In this case, the results are worse than in the daily format. The MACD strategy has only yielded 0.2% p.a. at a standard deviation of 9.85% or in other words less than 10% of the S&P 500 return at more than half of the standard deviation. Furthermore, it seems lucky that this strategy has even made it into positive territory over the last 17 years.

**Inverse MACD**

Again, doing the opposite:

Here, we are get a result that can keep up with the S&P 500 in terms of Sharpe ratio. This strategy returns 2.28% (SD: 14.45%) and outperforms the S&P 500 slightly based on risk-adjusted returns.

**Variable Signal Line Settings (EMA of the MACD)**

Using the daily MACD and playing with different signal line lengths (i.e. different EMAs of the MACD), we see the following results:

No setting yields better results than the S&P 500, and only the MACD EMA 24 setting has a better Sharpe ratio. However, due to the fragmented and random structure of these tests, there is no valuable conclusion to be made except for that the MACD does not generate meaningful excess returns.

**Conclusion**

The MACD indicator is one of many indicators that do not help investors. Rather, it minimizes return both by underperformance and by high turnover costs. Knowing that applying the inverted logic gives far better results than using the indicator in its standard format leaves only little hope that this popular, but ultimately lagging indicator has meaningful benefit for investors. Ultimately, however, the inverted MACD is equally not well-suited for tactical allocation. Also, applying different signal line settings in the MACD results in no alpha, in addition to which the results from different signal line settings show a random pattern.

**Disclosure:** I am/we are long SPY.

I wrote this article myself, and it expresses my own opinions. I am not receiving compensation for it (other than from Seeking Alpha). I have no business relationship with any company whose stock is mentioned in this article.