The calculation of the MACD is usually described as “subtracting the value of a 26-day exponential moving average from a 12-day exponential moving average.” That description is very close and it is how I usually describe the calculation of the MACD, but it isn’t precise.
Exponential moving averages are calculated by adding a percentage of today’s price to a percentage of the previous day’s exponential moving average. The percentages are determined from the number of periods (e.g., days) using the following formula:
exponential percentage = 2 / (number of periods + 1)
Given this formula, the percentage for a 12-day exponential moving average is 15.3846 percent and the percentage for a 26-day moving average is 7.4074 percent (these numbers actually have more digits, but I truncated them at 4 decimal places in this sentence). However, Appel originally defined the MACD as 15 percent and 7.5 percent exponential moving averages—slightly different from the percentage calculated using the above formula. Yes, the numbers are extremely close to those obtained by subtracting a 26-day exponential moving average from a 12-day exponential moving average, but the true MACD is calculated by subtracting a 15 percent exponential moving average from a 7.5 percent exponential moving average, which is the calculation below.