# The populare technical analysis tool – MACD

MACD (moving average convergence/divergence) is a technical analysis indicator used to spot changes in the strength, direction, momentum, and duration of a trend in a stock’s price.

The MACD is a computation of the difference between two exponential moving averages (EMAs) of closing prices. This difference is charted over time, alongside a moving average of the difference. The divergence between the two is shown as a histogram or bar graph.

Exponential moving averages highlight recent changes in a stock’s price. By comparing EMAs of different periods, the MACD line illustrates changes in the trend of a stock. Then by comparing that difference to an average, an analyst can chart subtle shifts in the stock’s trend.

Since the MACD is based on moving averages, it is inherently a lagging indicator. As a metric of price trends, the MACD is less useful for stocks that are not trending or are trading erratically.

The term “MACD” is used both generally, to refer to the indicator as a whole, and specifically, to the MACD line itself.

## Basic components

###### MACD 12,26,9

The graph shows a stock with a MACD indicator underneath it. The indicator shows a blue line, a red line, and a histogram or bar chart which calculates the difference between the two lines. Values are calculated from the price of the stock in the main part of the graph.

For the example above this means:

• MACD line (blue line): difference between the 12 and 26 days EMAs
• signal (red line): 9 day EMA of the blue line
• histogram (bar graph): difference between the blue and red lines

Mathematically:

• MACD = EMA[stockPrices,12] – EMA[stockPrices,26]
• signal = EMA[MACD,9]
• histogram = MACD – signal

The period for the moving averages on which an MACD is based can vary, but the most commonly used parameters involve a faster EMA of 12 days, a slower EMA of 26 days, and the signal line as a 9 day EMA of the difference between the two. It is written in the form, MACD (faster, slower, signal) or in this case, MACD(12,26,9).

## Interpretation

Exponential moving averages highlight recent changes in a stock’s price. By comparing EMAs of different lengths, the MACD line gauges changes in the trend of a stock. By then comparing differences in the change of that line to an average, an analyst can identify subtle shifts in the strength and direction of a stock’s trend.

Technical analysis stock traders recognize three meaningful signals generated by the MACD indicator.

When:

• the MACD line crosses the signal line
• the MACD line crosses zero
• there is a divergence between the MACD line and the price of the stock or between the histogram and the price of the stock

Graphically this corresponds to:

• the blue line crossing the red line
• the blue line crossing the x-axis (the straight black line in the middle of the indicator)
• higher highs (lower lows) on the price graph but not on the blue line, or higher highs (lower lows) on the price graph but not on the bar graph

And mathematically

### Signal–line crossover

Signal–line crossovers are the primary cues provided by the MACD. The standard interpretation is to buy when the MACD line crosses up through the signal line, or sell when it crosses down through the signal line.

The upwards move is called a bullish crossover and the downwards move a bearish crossover. Respectively, they indicate that the trend in the stock is about to accelerate in the direction of the crossover.

The histogram shows when a crossing occurs. Since the histogram is the difference between the MACD line and the signal line, when they cross there is no difference between them.

The histogram can also help in visualizing when the two lines are approaching a crossover. Though it may show a difference, the changing size of the difference can indicate the acceleration of a trend. A narrowing histogram suggests a crossover may be approaching, and a widening histogram suggests that an ongoing trend is likely to get even stronger.

While it is theoretically possible for a trend to increase indefinitely, under normal circumstances, even stocks moving drastically will eventually slow down, lest they go up to infinity or down to nothing.

### Zero crossover

A crossing of the MACD line through zero happens when there is no difference between the fast and slow EMAs. A move from positive to negative is a technical analysis bearish sign and from negative to positive, bullish. Zero crossovers provide evidence of a change in the direction of a trend but less confirmation of its momentum than a signal line crossover.