Indicators

MACD (Moving Average Convergence Divergence)

Built from EMAs -- MACD line, signal line, histogram, zero-line crossovers, and why it bridges trend and momentum.

What is MACD?

MACD (Moving Average Convergence Divergence) measures the relationship between two exponential moving averages of the price. When the faster EMA pulls away from the slower one, momentum is building. When they converge back together, momentum is fading.

MACD is one of the most widely used indicators in technical analysis. It sits at the intersection of trend and momentum -- the EMA crossover at its core is a trend signal, but the speed at which the gap changes is a momentum signal. This dual nature is why MACD appears in both trend-following and momentum strategies.

The Three Components

MACD produces three outputs, displayed together in a panel below the price chart:

MACD Line
The difference between the fast EMA (default: 12-period) and the slow EMA (default: 26-period). When the MACD line is above zero, the fast EMA is above the slow EMA. When it is below zero, the fast EMA is below the slow EMA.
MACD Line
MACD = EMA(close, 12) - EMA(close, 26)
Signal Line
An EMA of the MACD line itself (default: 9-period). This smooths the MACD line and creates a reference for crossover signals.
Signal Line
Signal = EMA(MACD line, 9)
Histogram
The difference between the MACD line and the signal line. When the histogram is positive, the MACD line is above the signal line (bullish). When it is negative, the MACD line is below the signal line (bearish). The height of the bars shows how far apart the two lines are.
Histogram
Histogram = MACD line - Signal line
0Signal crossoverMACD lineSignal lineHistogram
When the MACD line crosses below the signal line, the histogram turns negative (red). This signals that momentum is shifting from bullish to bearish.

Signal Types

Signal line crossover

When the MACD line crosses above the signal line, it is a bullish signal (the histogram turns from negative to positive). When it crosses below, it is bearish (the histogram turns from positive to negative). This is the most common MACD signal and is equivalent to saying "short-term momentum is shifting."

Zero-line crossover

When the MACD line crosses above zero, the 12-period EMA has crossed above the 26-period EMA -- a bullish trend signal. When it crosses below zero, the fast EMA has dropped below the slow EMA -- a bearish trend signal. Zero-line crossovers are slower than signal-line crossovers but are considered more significant.

MACD divergence

When the price makes a new high but the MACD line makes a lower high, momentum is fading even though the price is still rising (bearish divergence). The reverse -- price makes a lower low but MACD makes a higher low -- suggests selling momentum is weakening (bullish divergence). This is the same concept as RSI divergence, applied to MACD.

Parameters

Fast EMA (default: 12)
The shorter EMA period. A smaller value makes the MACD line more responsive to price changes.
Slow EMA (default: 26)
The longer EMA period. The gap between the fast and slow periods determines how much the MACD line moves.
Signal period (default: 9)
The EMA period applied to the MACD line to create the signal line. A shorter signal period makes signal-line crossovers more frequent.

The default 12/26/9 combination is the most widely used. It was popularized by Gerald Appel, who developed MACD. Changing these values is possible in Simula (range: 3-100 for each), but the defaults are a reasonable starting point for most assets and timeframes.

How Simula calculates MACD
Simula builds the MACD from three separate EMA calculations rather than using a single combined function. Built this way, it follows the standard MACD definition.

Things to Watch Out For

MACD is a lagging indicator

Because MACD is built from EMAs, it always reacts after the price has already moved. Signal-line crossovers confirm that momentum has shifted -- they do not predict it in advance. The faster you make the parameters, the earlier the signals but the more false crossovers you will see.

Whipsaws in ranging markets

When the price moves sideways, the two EMAs stay close together and the MACD line hovers near zero. Small fluctuations cause frequent crossovers that generate losing trades. Check ADX before acting on MACD signals -- if the trend is weak, MACD crossovers are unreliable.

The histogram is not volume

MACD histogram bars look like volume bars, but they measure the gap between the MACD line and the signal line -- nothing to do with trading volume. A shrinking histogram means the MACD and signal lines are converging, not that volume is declining.

Where to Go Next

ADX -- pair with MACD to filter out signals during weak trends.

EMA -- the building block that MACD is constructed from.

Trend Indicators Overview -- all 12 trend indicators available in Simula.

Trend Following -- strategies that use MACD crossovers as entry/exit signals.