MACD Calculation
The standard periods originally published by Gerald Appel are 12 and 26 days:
A trend-following momentum indicator that shows the relationship between two moving averages of prices. The MACD is calculated by subtracting the 26-day exponential moving average (EMA) from the 12-day EMA. A nine-day EMA of the MACD, called the “signal line”, is then plotted on top of the MACD, functioning as a trigger for buy and sell signals.
A signal line (or trigger line) is then formed by smoothing this with a further EMA. The standard period for this is 9 days,
The difference between the MACD and the signal line is often calculated and shown not as a line, but a solid block histogram style. This construction was made by Thomas Aspray in 1986. The calculation is simply