Does the MACD Indicator Alone Actually work for stocks?

Today, I chose to take out my personal vendetta on technical analysis. Technical Analysis is a form of data pseudoscience that takes advantage of the principle of “hindsight is 20/20”. Since, given a chart you can purposely manufacture a situation in that chart in which your investing principle is right and thus you are able to blind yourself successfully through confirmation bias. In this article, I hope to give a more data driven approach and evaluation to the MACD indicator.

What is the MACD indicator?

The MACD indicator is, in and of itself essentially a set of moving averages. For a MACD indicator you will measure the difference between moving averages with two windows sizes and then plot the difference as a line on a chart. Like with most all Technical Indicators, there are some different parameters that can be changed in order to alter the indicator. In this case we have :

  • Window Size 1
  • Window Size 2
  • Buy Indicator Value (Generally set to be >0)
  • Sell Indicator Value (Generally set to be <0)

These factors help the adaptability of the MACD indicator to be more malleable to any individual’s best guess at optimal parameters. For this article, we will not be going into the tuning of these hyperparameters but rather setting these to a set of base values that will be used throughout the article.

How can we evaluate this indicator?

For evaluation of this indicator, I chose to write a short and sweet python program to evaluate every piece of stock data that I could get my hands on in order to really get a lot of data for this indicator. The performance metric I will be using for a simple test is the percent return of the MACD indicator on it’s own, as well as the average weekly Sharpe ratio. A Sharpe ratio is a value that represents the “Risk Adjusted Return” of a set of numbers rather than being purely related to direct return.

A Sharpe ratio gives a significantly better tell of performance than the percentage return for any investment strategy and is generally the more acceptable performance metric in the world of quantitative analysis. I’ve included a hand dandy chart from https://getmoneyrich.com/sharpe-ratio/ to show what is a “good” sharpe ratio and what is a “bad” sharpe ratio. The actual meaning is beyond the more precise meaning will be covered more precisely in another post.

Sharpe Ratio - Thumb Rule

For this test, I was able to get my hands on about 2000 individual stock histories in order to test the MACD indicator with it’s basic settings and I placed my testing in the capable hands of the backtrader package for python.

Now down to the test itself.

Alright, so I ran my stocks through my short little dataset, running the MACD indicator through over 2000 individual stocks and…beware the results may be suprising.

Over the entire history of 2000 stocks the MACD had an average return of 1% and an average Sharpe ratio of -0.011

So, is this good? bad? ugly? Well, a Sharpe ratio of 0.5 is what you can expect from a hedge fund what we see here would be considered a very very bad Sharpe ratio. What does this mean? This means that in terms of effective risk vs return the MACD indicator is VERY bad. Considering that the MACD is very bad it is a very bad idea to use for any legitimate portfolio or investing strategy.

Below you can see a plot with the 2000 stocks in the portfolio. I decided to plot the sharpe ratio vs return for each individual stock. This is not representative of any realistic use case, as these things, while generally related are not necessarily correlated in any meaningful way but it sure does look nice.

Conclusion

In this article, I explored the effectiveness of the Moving Average Convergence Divergence Indicator through thorough backtesting and evaluation of both the return and Sharpe ratio over a portfolio of 2000 stocks. This experiment has shown that the MACD on it’s own has an average return of 1 Percent and a HORRIBLE Sharpe ratio of -0.011.

Due to the conclusion, I do not suggest the MACD be used in any investing or portfolio management for those hoping to realistically build wealth. However, I doubt that people using the MACD indicator to manage their portfolio would have the attention span to read this post in the first place.

Thank you again dear reader for making it to the end of the post. Check out my social media and my discord to suggest article ideas and other strategies for me to backtest or if you just wanna talk to a cool guy like me.

Don’t just take my word for it!

I’m a certifiable idiot! You should read some actual research before coming to a real conclusion

Aguirre, Alberto Antonio Agudelo, Ricardo Alfredo Rojas Medina, and Néstor Darío Duque Méndez. “Machine learning applied in the stock market through the Moving Average Convergence Divergence (MACD) indicator.” Investment Management & Financial Innovations 17.4 (2020): 44.

The Journal of Wealth Management Apr 2003, 6 (1) 27-36; DOI: 10.3905/jwm.2003.320471

Various moving average convergence divergence trading strategies: a comparison

Leave a Reply

Your email address will not be published. Required fields are marked *