MACD

What is MACD in forex and CFD trading

The MACD, or Moving Average Convergence Divergence, is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price, often plotted with a centerline and a histogram. The MACD matters for real trading decisions because it clearly identifies trend direction, strength, and momentum shifts, generating objective buy and sell signals through crossovers and divergences, particularly on trending instruments. A trader verifies the MACD by applying the indicator to a price chart, observing the crossover of the MACD line and the Signal line, and noting the position and size of the histogram bars.

Key facts about MACD

  • Classification: A lagging, unbounded trend and momentum oscillator, based on Exponential Moving Averages (EMAs).
  • Default Settings: The standard and most common setting is the (12, 26, 9), where 12 and 26 are the lookback periods for the EMAs, and 9 is the period for the Signal line’s EMA.
  • Components: The MACD consists of three elements: the MACD Line, the Signal Line, and the Histogram.
  • Centerline: The 0 line is the centerline; movement above 0 suggests positive momentum (bullish), and below 0 suggests negative momentum (bearish).
  • Signal Generation: The primary buy/sell signal is a cross of the MACD Line over or under the Signal Line.
  • Histogram Function: The Histogram visually represents the difference between the MACD Line and the Signal Line, illustrating momentum acceleration or deceleration.
  • Divergence Signal: A high-probability reversal signal is generated when the price makes a new high/low, but the MACD fails to follow suit, indicating momentum exhaustion.

How MACD works in forex and CFD trading

The MACD works by calculating the speed at which two Exponential Moving Averages (EMAs) are separating from or moving towards each other, which translates price momentum into a quantitative value plotted around a centerline.

Calculation follows these steps:

  1. Calculate the MACD Line: The first EMA (fast, typically 12 periods) is subtracted from the second EMA (slow, typically 26 periods): MACD Line = EMA₁₂ – EMA₂₆
  2. Calculate the Signal Line: A 9-period EMA of the MACD Line itself is calculated, which serves as a smoothed reference line: Signal Line = EMA₉ of the MACD Line
  3. Calculate the Histogram: The final component is the difference between the two lines, plotted as bars: Histogram = MACD Line – Signal Line

Crossover Signal: A bullish crossover (buy signal) occurs when the MACD Line moves above the Signal Line; a bearish crossover (sell signal) occurs when the MACD Line moves below the Signal Line.

Centerline Confirmation: Crossovers occurring above the 0 line confirm bullish momentum, while crossovers below the 0 line confirm bearish momentum.

Example of MACD with a real trade

This example demonstrates using the MACD crossover to generate a short entry signal on EUR/USD.

  • Instrument: EUR/USD on the H4 chart
  • Indicator Used: MACD (12, 26, 9)
  • Trend Condition: Price has been moving sideways, then begins to drop; the MACD is above the 0 line but starting to fall.
  • Entry Signal: The MACD Line crosses below the Signal Line at 1.09500.
  • Entry: Sell Market Order placed at 1.09500.
  • Stop-Loss: 1.09800 (Placed 30 pips above the previous swing high).
  • Position size: 2 mini lots (20,000 units).

Trade Calculation (Hypothetical successful short entry): The bearish crossover is confirmed, and the Sell Market order is executed at 1.09500. Price subsequently drops to 1.08700, where the trader exits based on a divergence signal on the MACD. Gross Profit (Pip Gain): 1.09500 – 1.08700 = 80 pips. Commission: $0.00 (zero commission structure) Spread Cost: 0.2 pips × $2/pip × 2 lots = $0.80 Net PnL: 80 pips × $2/pip × 2 lots – $0.80 = $319.20

Result: $319.20 net profit. The MACD crossover provided the timed entry signal for the start of the downtrend. Zero commission structure eliminates per-trade execution costs.

How MACD affects your cost and risk

The MACD indicator affects risk by defining trend direction, which determines the probability of a trade, and affects potential cost by generating signals that may be slightly late in fast-moving markets.

MACD compared with related concepts

MACD vs Relative Strength Index (RSI)

The MACD is an unbounded indicator that primarily identifies trend direction, strength, and momentum shifts relative to a zero centerline, derived from the absolute price difference of two moving averages. The Relative Strength Index (RSI) is a bounded oscillator (0-100) that measures the speed and magnitude of price changes, focused on identifying overbought (>70) and oversold (<30) conditions. MACD confirms the trend, whereas RSI highlights extremes within the trend.

MACD vs Moving Averages (MA)

The MACD is a derivative of moving averages, representing the difference between a fast and slow EMA, which makes it a momentum oscillator. Moving Averages are lines plotted directly on the price chart, used for identifying dynamic support, resistance, and the smoothed trend direction. Trading a simple MA crossover means waiting for the price and the MA to meet, whereas trading the MACD crossover means exploiting the velocity difference between the MAs.

Broker differences in MACD across the industry

Differences in MACD across brokers are related to the available parameters, the averaging method used, and the quality of the price data input.

How to verify MACD on your trading platform

Verifying and utilizing the MACD (Moving Average Convergence Divergence) involves correctly applying it and checking its core components.

  • Open Indicator List: In your trading platform, navigate to the ‘Indicators’ section, expand ‘Oscillators’, and select ‘MACD’.
  • Set Parameters: In the settings window, confirm the default parameters: ‘Long Cycle’ to 26, ‘Short Cycle’ to 12, and ‘Signal Periods’ to 9.
  • Confirm Display: Ensure the MACD is plotted in a separate panel below the price chart, showing three distinct visual components (two lines and a histogram).
  • Verify Centerline: Visually locate the horizontal 0 line and observe that the histogram bars extend above and below this line.
  • Look for Divergence: Check a recent significant price high; if the MACD histogram makes a lower high, a divergence exists.
  • Analyze Crossover: Find a point where the MACD Line crosses the Signal Line and note if this correlates with a change in the price trend direction.
  • Sanity check: The MACD Line and Signal Line must oscillate without being bound by fixed upper or lower limits, distinguishing it from indicators like the RSI.

For more detailed explanations of these and other concepts, explore other trading terms in our full glossary.

Related Tools

Use these calculators to apply what you've learned:

No Fine Print. Better Trading Economics.

Built on transparency. Lowest total trading costs.
Execution you can measure. Rewards shared with you.

Invite only access for approved trading profiles.