Knowledge · Terms · MACD

MACD

Indicator indicator
Moving Average Convergence Divergence
Difference of two EMAs (12/26) plus a signal EMA (9). Measures trend momentum and delivers crossover signals.
Example chart
BTC/USDT · 4h · last 90 days
Loading chart data…

What is MACD?

Gerald Appel developed the Moving Average Convergence Divergence in the late 1970s. It combines two EMAs of different lengths into an oscillator and thereby shows whether the short-term trend is moving away from or converging toward the long-term one.

MACD-Line   = EMA(close, 12) − EMA(close, 26)
Signal-Line = EMA(MACD-Line, 9)
Histogramm  = MACD-Line − Signal-Line

The three components

  • MACD line — difference 12-EMA − 26-EMA. Above zero = momentum bullish, below zero = bearish.
  • Signal line — 9-EMA on the MACD line. Crossings = classic entry/exit signals.
  • Histogram — visualizes the distance MACD − signal. When the histogram grows, momentum is accelerating.

Interpretation

  • Bullish crossover — MACD crosses the signal line from below to above ⇒ long hint.
  • Bearish crossover — MACD crosses the signal line from above to below ⇒ short hint.
  • Divergence — price makes a higher high, MACD does not ⇒ the trend is losing momentum.
  • Zero line — MACD above zero confirms an uptrend.

How Botty uses MACD

indicators/compute.py computes MACD(12, 26, 9) once per tick. The MACD_CROSSOVER strategy trades on signal-line crossings with an ATR stop.

Pros and cons

✅ Combines trend + momentum in a single indicator. ✅ The histogram visualizes acceleration earlier than the crossovers do.

❌ Many false signals in sideways markets (classic whipsaw). ❌ Lagging in character — reacts late in fast markets.