Home ยป MACD Indicator Explained, with Formula, Examples, and Limitations

MACD Indicator Explained, with Formula, Examples, and Limitations

« Back to Glossary Index

Moving average convergence/divergence (MACD, or MAC-D) is aย trend-followingย momentumย indicator that shows the relationship between twoย exponential moving averages (EMAs)ย of aย securityโ€™sย price. The MACD line is calculated by subtracting the 26-period EMA from the 12-period EMA.

The result of that calculation is the MACD line. A nine-day EMA of the MACD line is called the signal line, which is then plotted on top of the MACD line and can function as a trigger for buy or sell signals. Traders may buy the security when the MACD line crosses above the signal line and sellโ€”or shortโ€”the security when the MACD line crosses below the signal line. MACD indicators can be interpreted in several ways, but the more common methods areย crossovers,ย divergences, and rapid rises/falls.

MACD Formula

MACD=12-Periodย EMAย โˆ’ย 26-Periodย EMA

MACD is calculated by subtracting the long-term EMA (26 periods) from the short-term EMA (12 periods). An EMA is a type ofย moving average (MA)ย that places a greater weight and significance on the most recent data points.

The exponential moving average is also referred to as the exponentiallyย weightedย moving average. An exponentially weighted moving averageย reacts more significantly to recent price changes than aย simple moving average (SMA), which applies an equal weight to all observations in the period.

Learning from MACD

MACD has a positive value (shown as the blue line in the lower chart) whenever the 12-period EMA (indicated by the red line on the price chart) is above the 26-period EMA (the blue line in the price chart) and a negative value when the 12-period EMA is below the 26-period EMA. The level of distance that MACD is above or below itsย baselineย indicates that the distance between the two EMAs is growing.

In the following chart, you can see how the two EMAs applied to the price chart correspond to the MACD (blue) crossing above or below its baseline (red dashed) in the indicator below the price chart.

MACD is often displayed with aย histogramย (see the chart below) that graphs the distance between MACD and its signal line. If MACD is above the signal line, the histogram will be above the MACDโ€™s baseline or zero line. If MACD is below its signal line, the histogram will be below the MACDโ€™s baseline. Traders use the MACDโ€™s histogram to identify when bullish or bearish momentum is highโ€”and possibly overbought/oversold.

MACD vs. Relative Strength

Theย relative strength index (RSI)ย aims to signal whether a market is considered to beย overboughtย orย oversoldย in relation to recent price levels. The RSI is an oscillator that calculates average price gains and losses over a given period of time. The default time period is 14 periods with values bounded from 0 to 100. A reading above 70 suggests an overbought condition, while a reading below 30 is considered oversold, with both potentially signaling a top is forming, or vice versa (a bottom is forming).

The MACD lines, however, do not have concrete overbought/oversold levels like the RSI and other oscillator studies. Rather, they function on a relative basis. Thatโ€™s to say an investor or trader should focus on the level and direction of the MACD/signal lines compared with preceding price movements in the security at hand, as shown below.

Related Terms