← Glossary

Indicators

MACD

Moving Average Convergence/Divergence. The gap between a fast and a slow EMA, plus a signal line, used to time momentum shifts.

MACD compresses two moving averages into one momentum series:

MACD line   = EMA(12) − EMA(26)
signal line = EMA(9) of the MACD line
histogram   = MACD line − signal line

When the fast EMA pulls away above the slow one, MACD rises: momentum is building. When they converge, momentum is fading.

The three classic reads

The standard bullish trigger is MACD crossing above its signal line (and below for bearish); it fires often, early, and noisily. The zero-line cross is slower and trendier, since MACD above zero just means the 12-EMA is above the 26-EMA at all. And divergence, where price prints a higher high while MACD prints a lower one, warns that the move is stretching thinner.

In backtests

The 12/26/9 defaults are Appel's 1970s daily-chart settings, not laws of nature. Re-tuning them per asset, though, is a fast route to overfitting. MACD systems behave like what they are, smoothed trend-momentum: they shine in sustained trends and bleed in ranges, so they're usually paired with a regime filter rather than traded raw.

On AlphaProve

The macd indicator returns all three components (line, signal, and histogram), so a no-code condition can compare the line to its signal or to zero directly. The divergence read from the section above is the one thing no-code can't express: spotting a lower MACD high beneath a higher price high needs the Python divergence helper on ctx.indicators, which the JSON builder doesn't surface, so a divergence strategy takes the Python path.