MACD & Signal Line Calculator

Category: Technical Analysis

Calculate Moving Average Convergence Divergence (MACD) and Signal Line to identify trend momentum, potential reversals, and trading signals

Price Data Input

Enter one price value per line, with most recent data at the top
Select a market to load sample data
Type of price data to use for calculation

MACD Parameters

Fast EMA period (standard is 12)
Slow EMA period (standard is 26)
Signal line EMA period (standard is 9)
How to display MACD histogram values
Method used to generate trading signals
Periods to check for divergence patterns

Understanding MACD (Moving Average Convergence Divergence)

The Moving Average Convergence Divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a security's price. It was developed by Gerald Appel in the late 1970s and is one of the most popular indicators in technical analysis.

How MACD Works

The MACD consists of three components:

MACD Line = Fast EMA - Slow EMA
Signal Line = EMA of MACD Line
Histogram = MACD Line - Signal Line

Standard settings are 12-period Fast EMA, 26-period Slow EMA, and 9-period Signal Line EMA.

  • MACD Line: Shows the difference between fast and slow EMAs, reflecting momentum shifts
  • Signal Line: Acts as a trigger for buy and sell decisions
  • Histogram: Visualizes the distance between MACD and Signal lines, showing momentum strength

Interpreting MACD

  • Crossovers: When MACD crosses above the Signal line, it's a bullish signal. When it crosses below, it's bearish.
  • Zero Line Crosses: When MACD crosses above zero, it indicates bullish momentum. When it crosses below, bearish momentum.
  • Divergence: When price makes a new high/low but MACD doesn't confirm with its own new high/low, it suggests potential reversal.
  • Histogram Changes: When the histogram grows, momentum is increasing in the direction of the trend. When it shrinks, momentum is decreasing.

MACD Trading Strategies

Signal Line Crossovers

The most common MACD trading signal occurs when the MACD line crosses the signal line:

Buy Signal: MACD line crosses above the signal line

Sell Signal: MACD line crosses below the signal line

These crossovers are most reliable when they align with the overall trend.

Zero Line Crosses

The MACD crossing the zero line indicates a change in the direction of the trend:

Buy Signal: MACD crosses above the zero line, indicating a shift from bearish to bullish momentum

Sell Signal: MACD crosses below the zero line, indicating a shift from bullish to bearish momentum

Zero line crosses can be used to confirm the overall trend direction.

MACD Divergence

Bullish Divergence: Price makes lower lows while MACD makes higher lows, suggesting weakening downward momentum.

Bearish Divergence: Price makes higher highs while MACD makes lower highs, suggesting weakening upward momentum.

Divergences are powerful signals of potential reversals, especially at market extremes.

Histogram Analysis

The MACD histogram visualizes the difference between the MACD line and the signal line:

Increasing positive histogram: Bullish momentum is strengthening

Decreasing positive histogram: Bullish momentum is weakening

Increasing negative histogram: Bearish momentum is strengthening

Decreasing negative histogram: Bearish momentum is weakening

Tips for Using MACD Effectively

  • Confirm with price action - Always confirm MACD signals with actual price movements and other indicators for greater reliability
  • Consider the broader trend - MACD signals are generally more reliable when they align with the broader market trend
  • Watch for divergence - MACD divergence can be one of the most reliable indicators of potential trend reversals, especially at market extremes
  • Filter signals - Use zero line position to filter signals; for example, only take buy signals when MACD is above zero in an uptrend
  • Adjust parameters - Standard settings (12, 26, 9) work well for daily charts, but you may need to adjust for different timeframes
  • Be aware of lag - Like all indicators based on moving averages, MACD has inherent lag and works best in trending markets

What this calculates

MACD line, signal line and histogram from two exponential moving averages.

Formula
MACD = EMA(12) − EMA(26); signal = EMA(9) of MACD; histogram = MACD − signal
Worked example
If EMA(12) is 1.0870 and EMA(26) is 1.0850, MACD = 0.0020. When the 9-period EMA of that line is below it, the histogram is positive.
When to use it
To see whether short-term momentum is pulling away from the longer trend.
Common mistake
MACD is built from lagging averages, so crossovers arrive after the move. In a sideways market it produces a stream of false signals.