askvity

How is MACD Calculated?

Published in Technical Analysis Calculation 2 mins read

Moving Average Convergence Divergence (MACD) is calculated by subtracting the 26-period exponential moving average (EMA) from the 12-period EMA. This simple calculation forms the basis of one of the most popular technical indicators used in financial analysis.

Understanding the Core MACD Calculation

The MACD line is derived directly from two different exponential moving averages of a security's price. Specifically, to find the MACD value for any given period, you take the value of the 12-period EMA and subtract the value of the 26-period EMA.

The formula is straightforward:

MACD Line = (12-period EMA) - (26-period EMA)

Both EMAs typically use the closing price of the security for each period (e.g., day, week, month).

Components of the MACD Line

The calculation involves just two key components:

  • Shorter-Period EMA: Usually the 12-period EMA. This EMA reacts more quickly to recent price changes.
  • Longer-Period EMA: Usually the 26-period EMA. This EMA reacts more slowly, smoothing out price fluctuations.

The difference between these two lines creates the MACD line, which oscillates around a zero line.

MACD and the Signal Line

While the MACD line itself is calculated as described above, the MACD indicator system also typically includes a "signal line." The signal line is commonly a 9-period EMA of the MACD line itself. According to the reference, MACD triggers technical signals when it crosses above (to buy) or below (to sell) its signal line. However, it's important to note that the signal line is a separate calculation based on the MACD line, not part of the MACD line's primary calculation using the 12 and 26-period EMAs.

Related Articles