The MACD is the famous indicator invented by Gerald Appel in the 70s. It measures the amplitude of divergence between two moving averages. This indicator is very popular, systematically found in all trading platforms. It can be used in different type of strategy: like momentum indicator for trend following, oscillator for range-trading, etc. … In this article we will see how someone could reinvent the MACD. The goal of the exercise is to learn together some techniques and mathematical manipulations that can eventually help you later to create your own indicators to highlight a particular observation or answer any needs.
I take this opportunity to pay tribute to this talented man who created the MACD Gerald Appel. It is always easier to reinvent the wheel when someone has already done. Mr. Appel, in addition to being an outstanding manager and trader, is the author of several books on trading, including:
- Stock Market Trading Systems: A Guide to Investment Strategy.
- Technical Analysis: Power Tools for Active Investors.
By observing the graph of the EURUSD, you notice that the price moves in the form of waves. And in addition, this movement is around moving average waves which was displayed on your graph. You say to yourself, it would be interesting to isolate this movement back and forth around the moving average and the highlight on a graph separately. The first instinct that comes into your head and subtract the moving average price and the result is a line that oscillates around zero.
You’re already proud of your results, but you find that the line is not smooth enough to your taste. You think immediately to smooth using a moving average. So instead of displaying the difference between the price and its moving average, you decide to show the difference between two moving averages, a fast MA (period = 12) used to smooth prices and a slow MA (period = 26 ) which serves as a pivot around which oscillates the price. And this is how you get your first version of MACD.
You start already to think about how to develop a trading strategy based on your new creation. You say to yourself, I’ll hang position based on my MACD crossing with the zero line. When it crosses the bottom to the top, I buy and when it crosses the top down I sell. And suddenly, you smile because you realize that your strategy is none other than the famous strategy of crossing of two moving averages. But you want to innovate and the idea you just try to get in position earlier using something you’ve seen playing with the stochastic. It was to use another curve which crossing signals a change in momentum (hence its name: signal curve). This is simply a moving average of small period (period = 9) of your MACD.
Then, the ideas of strategies begin to rush through your head, and you decide to note to not forget them:
- Strategy # 1: Buy when MACD crosses its signal from the bottom upwards and close the position when the MACD crosses zero. Sell when the MACD crosses its signal from high to low and close position when the MACD crosses zero.
- Strategy # 2: Buy when the MACD crosses its signal from the bottom to the top. Sell when the MACD crosses its signal from high to low. Each position closes the previous one. (Stop & Reverse)
- Option # 1 Strategy # 2: Buy when the MACD crosses its signal from the bottom to the top and MACD below zero. Sell when the MACD crosses its signal from high to low and MACD greater than zero. Each position closes the previous one. (Stop & Reverse)
- Option # 2 Strategy # 2: Buy when the MACD crosses its signal from the bottom to the top and MACD above zero; Close position when the MACD crosses its signal in the opposite direction and the MACD is still greater than zero. Buy when the MACD crosses its signal from the top down and MACD below zero; Close position when the MACD crosses its signal in the opposite direction and the MACD is still below zero. (Note: This is a simulated purchase of correction in the direction of the trend.)
And a new idea has emerged of your head. Your MACD is an oscillator unbounded. It would be good if you can turn it into a bounded oscillator (between 0 and 100) to be able to use it to identify areas of over-bought and over-sold in a range-trading strategy. And, once again, new ideas for strategies begin to shake in your head. Except this time, you are no longer able to resist the urge to sleep and you say: “I’ll finish it tomorrow, or … maybe next week.”
To be continued …