MACD (Moving Average Convergence Divergence)
MACD plots the difference between a 12-period EMA and a 26-period EMA, alongside a 9-period EMA of that difference (the signal line). Crossovers between the two lines mark momentum shifts.
Components
- MACD line — 12 EMA minus 26 EMA
- Signal line — 9 EMA of the MACD line
- Histogram — MACD line minus signal line
Common signals
A bullish MACD crossover (MACD line crosses above signal) often precedes EMA crossovers, providing earlier entry. The histogram visualises momentum: growing bars = accelerating, shrinking = decelerating.
MACD in Pine Script
[macdLine, signalLine, histLine] = ta.macd(close, 12, 26, 9)
if ta.crossover(macdLine, signalLine)
strategy.entry("Long", strategy.long)Strategies that use MACD (Moving Average Convergence Divergence)
Related Terms
EMA (Exponential Moving Average)
The exponential moving average weights recent price data more heavily than older bars, making it faster to react than a simple moving average.
RSI (Relative Strength Index)
The RSI oscillates between 0 and 100, measuring the velocity of recent gains vs losses to identify overbought and oversold conditions.
Stop Reading. Start Trading.
PineForge backtests every concept on this site against real market data.
Try It Free