Explainer
What is EMA 12 and 26 (MACD)?
MACD is the 12-period EMA minus the 26-period EMA of the close, drawn with a 9-period EMA of that difference as a signal line.
Updated
The short answer
MACD stands for moving average convergence divergence. Its main line is the 12-period EMA of the close minus the 26-period EMA of the close. When the faster average is above the slower, the line is above zero. When it is below, the line is below zero.
Most charts then add a signal line, which is a 9-period EMA of the MACD line, and a histogram that shows the gap between the two. So the 12 and 26 are the inputs, and the 9 smooths the result.
- MACD line
- 12-period EMA of the close minus 26-period EMA of the close.
- Signal line
- A 9-period EMA of the MACD line.
- Histogram
- The MACD line minus the signal line, drawn as bars around zero.
- Zero line
- The level where the 12 EMA and the 26 EMA are equal.
How it is built
Take the 12 EMA and the 26 EMA of the close. Each is an ordinary EMA: EMA today = close × k + EMA yesterday × (1 − k), with k = 2 ÷ (period + 1). Subtract the 26 from the 12 on every bar. The result is the MACD line.
The line tells you the distance between a faster and a slower average. When price rises fast, the 12 pulls away from the 26 and the line rises. When price flattens, the two come back together and the line falls toward zero. That coming together is the convergence in the name.
How people use it
Three readings are common. The MACD line crossing the signal line is read as a change in momentum. The MACD line crossing zero is the same as the 12 crossing the 26. And the histogram shrinking is read as momentum fading, even before a cross.
Some traders also compare the MACD line against price and look for divergence, where price makes a new extreme and the line does not. These are descriptions of how the averages relate to each other. They are not forecasts.
MACD is built entirely from past closes. It reshapes what price already did and adds no new information.
What it cannot tell you
Because it is made of averages of averages, MACD is late. A cross of the signal line arrives after the move that caused it. In a sideways market it crosses over and over, and the signals contradict each other.
It also gives no target and no stop, and it does not measure risk. The default settings of 12, 26 and 9 are conventions. Other settings give different crosses, and no setting is certain to do anything.
The futures angle
The three periods are counted in bars, so the chart timeframe decides the clock time they cover. The same 12, 26 and 9 on a 1-minute chart and on a daily chart are very different tools.
A rule built on MACD signals on a bar close, so it can first be acted on at the next bar. In our method, a signal that appears when a bar closes is acted on at the next bar’s open. Costs apply to every trade it takes.
You can write a MACD rule in plain words and run it on past data. Replay it on real NQ data, free, in the Trade Lab.
Questions and answers
What do the numbers 12, 26 and 9 mean in MACD?
The 12 and 26 are the periods of the two EMAs of the close. The 9 is the period of the EMA of the MACD line that makes the signal line. They are standard settings, not fixed laws.
How is MACD calculated?
MACD line = 12-period EMA minus 26-period EMA. Signal line = 9-period EMA of the MACD line. Histogram = MACD line minus signal line.
What does it mean when the MACD line crosses above zero?
The 12 EMA has moved above the 26 EMA. It records that recent closes are higher relative to the longer average, and it does not forecast what comes next.
Is MACD a leading or lagging indicator?
It lags. It is calculated from past closes, so it can only show what price has already done.
Can I change the MACD settings?
Yes. Any periods can be used. The result changes with them, so a rule should say which settings it uses, and a test should run those exact ones.