Risk warning: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. Risk disclosure
Education12 min read

MACD indicator explained: settings, crossovers, histogram and how to use MACD in MT5

Learn how the MACD indicator works, what the 12 26 9 settings mean, how to read crossovers, the histogram and divergence, and how to add MACD in MT5.

MACD indicator with MACD line, signal line and histogram under a EUR/USD H4 chart
On this page
  1. What is the MACD indicator?
  2. The three parts of MACD
  3. MACD settings 12 26 9 explained
  4. How MACD is calculated: a worked example
  5. How to read a MACD crossover
  6. Signal line crossover
  7. Zero line crossover
  8. Which crossovers matter most?
  9. The MACD histogram: reading momentum
  10. MACD divergence
  11. How to add MACD in MT5
  12. Combining MACD with other indicators
  13. A simple MACD trade plan (example)
  14. Common MACD mistakes
  15. Practise MACD first, then go live

The MACD indicator is one of the most popular tools in technical analysis. MACD stands for Moving Average Convergence Divergence. It takes two moving averages of price, measures the gap between them, and turns that gap into a line, a signal line and a histogram that sit under your chart. Traders use it to judge the direction of a trend, how strong the momentum is, and when that momentum may be fading.

This guide explains how MACD is calculated, what the standard MACD settings 12 26 9 mean, how to read a MACD crossover, the MACD histogram and MACD divergence, and how to add MACD in MT5. Every example uses simple numbers you can check on a free demo account. One point up front: MACD is built from past prices, so it always lags. It describes what momentum has been doing – it does not predict what price will do next.

What is the MACD indicator?

MACD was created by Gerald Appel in the late 1970s and is now built into almost every charting platform, including MetaTrader 5. It is a momentum and trend-following indicator: it shows whether a short-term average of price is moving away from, or back towards, a longer-term average.

  • When the short average rises faster than the long average, the two diverge and MACD rises. Upward momentum is building.
  • When the short average slows down and moves back towards the long one, they converge and MACD falls back towards zero. Momentum is fading.

That is where the name comes from. Because it is based on moving averages, it helps to understand those first – our guide to moving average trading explains simple and exponential moving averages (SMA and EMA) step by step.

The three parts of MACD

When you add MACD to a chart, you see three things in a separate window below price:

  • MACD line · How it is calculated: 12-period EMA − 26-period EMA · What it tells you: Direction and strength of momentum
  • MACD signal line · How it is calculated: 9-period EMA of the MACD line · What it tells you: A smoothed version of MACD, used for crossovers
  • MACD histogram · How it is calculated: MACD line − signal line · What it tells you: Whether momentum is speeding up or slowing down
  • Zero line · How it is calculated: Where the 12 and 26 EMAs are equal · What it tells you: Above zero = short average above long average

The MACD line is the heart of the indicator. The signal line and histogram are both derived from it, which is why they react a little later.

MACD settings 12 26 9 explained

The default MACD settings 12 26 9 mean:

  1. 12 – the fast EMA, covering the last 12 candles.
  2. 26 – the slow EMA, covering the last 26 candles.
  3. 9 – the EMA used to smooth the MACD line into the signal line.

These numbers date back to when markets traded six days a week, so 12 and 26 were roughly two weeks and a month of daily data. They are still the standard because so many traders use them, and most traders never change them.

You can adjust them, but every change has a trade-off:

  • Faster settings (for example 5, 13, 5 or 8, 17, 9) react sooner but give more false signals.
  • Slower settings (for example 19, 39, 9) give fewer signals, but they arrive later.

If you are new to the MACD indicator, stick with 12, 26, 9 until you understand how it behaves on the pairs and timeframes you trade. Changing the settings to make past signals look perfect usually makes future signals worse.

How MACD is calculated: a worked example

You do not need to calculate MACD by hand – MT5 does it for you – but seeing the numbers once makes the lines much easier to read.

Say EUR/USD is in a gentle uptrend on the H4 chart:

  • 12-period EMA = 1.08500
  • 26-period EMA = 1.08300

MACD line = 1.08500 − 1.08300 = 0.00200 (20 pips)

Now the signal line. An EMA gives more weight to recent values. For a 9-period EMA the weight is 2 ÷ (9 + 1) = 0.2. If yesterday's signal line was 0.00120:

Signal line = 0.00120 + 0.2 × (0.00200 − 0.00120) = 0.00136

Histogram = MACD − signal = 0.00200 − 0.00136 = 0.00064

  • MACD line · Result: +0.00200 · Reading: Fast EMA is 20 pips above slow EMA – upward momentum
  • Signal line · Result: +0.00136 · Reading: MACD is above its signal line
  • Histogram · Result: +0.00064 (positive bar) · Reading: Momentum is still increasing

If the next few candles push the histogram bars lower while they stay above zero, the uptrend is still in place but losing speed. That is often the first thing MACD traders notice.

Note that MACD is measured in price units, so the numbers on EUR/USD (around 0.001) look very different from gold or an index. Compare MACD with its own past readings on the same chart, not across different markets.

How to read a MACD crossover

The MACD crossover is the signal most traders learn first. There are two kinds.

Signal line crossover

  • Bullish MACD crossover: the MACD line crosses above the signal line. Short-term momentum is turning up.
  • Bearish MACD crossover: the MACD line crosses below the signal line. Short-term momentum is turning down.

On the histogram, a signal line crossover is the moment the bars flip from negative to positive (bullish) or positive to negative (bearish).

Zero line crossover

  • When the MACD line moves above zero, the 12 EMA has crossed above the 26 EMA – the same as a moving average crossover.
  • When it moves below zero, the 12 EMA has crossed below the 26 EMA.

Zero line crossovers come later than signal line crossovers, but they confirm that the trend itself has changed, not just short-term momentum.

Which crossovers matter most?

Not all crossovers are equal. Many traders filter them like this:

  • Bullish crossover below zero, in an uptrend on a higher timeframe · How traders often read it: Pullback may be ending – a stronger buy setup
  • Bullish crossover above zero, after a long rise · How traders often read it: Late in the move – weaker setup
  • Bearish crossover above zero, in a downtrend on a higher timeframe · How traders often read it: Bounce may be ending – a stronger sell setup
  • Many crossovers close to zero · How traders often read it: Sideways market – MACD signals are unreliable

That last row matters. In a range, the MACD line and signal line wrap around each other and give one false crossover after another. If price is stuck between support and resistance levels, a crossover on its own means very little.

The MACD histogram: reading momentum

The MACD histogram turns the gap between the MACD line and the signal line into bars, which makes changes in momentum easy to see.

  • Bars above zero and growing: bullish momentum is increasing.
  • Bars above zero but shrinking: price may still be rising, but momentum is slowing.
  • Bars below zero and growing (getting longer downwards): bearish momentum is increasing.
  • Bars below zero but shrinking: selling pressure is easing.

Because the histogram is the difference between two lines, it often turns before the crossover happens. Some traders watch for the first shorter bar after a run of long bars as an early warning – then wait for the crossover or a price signal, such as one of the reversal candlestick patterns, before acting.

MACD divergence

MACD divergence is when price and the indicator disagree. It can warn that a trend is running out of energy.

  • Bearish divergence: price makes a higher high, but the MACD line (or histogram) makes a lower high. The new high was reached with less momentum.
  • Bullish divergence: price makes a lower low, but MACD makes a higher low. Sellers pushed price lower with less force.

Example: gold (XAU/USD) rises to a high, pulls back, then rises to a slightly higher high. On the first high the MACD line peaked at +6.0; on the second it peaks at only +3.5. That is bearish divergence – the second push was weaker.

Two cautions:

  1. Divergence can last a long time. In a strong trend, MACD can show divergence several times while price keeps going.
  2. Divergence is a warning, not an entry. Many traders wait for a bearish MACD crossover, a break of a trendline or a key level, or a reversal candle before acting on it.

Divergence works especially well when it appears at a level you already have marked, such as a previous high or a Fibonacci retracement zone.

How to add MACD in MT5

Adding MACD in MT5 takes a few clicks on desktop or web:

  1. Open the chart you want – for example EUR/USD on H1 or H4.
  2. Go to Insert → Indicators → Oscillators → MACD.
  3. In the window that opens, set Fast EMA 12, Slow EMA 26, MACD SMA 9 and Apply to: Close.
  4. Change the colours in the Colors tab if you like, then click OK.

One thing surprises new users: MetaTrader's built-in MACD looks different from most other charts. In MT5, the MACD line is drawn as bars and the signal line is drawn as a dotted line, and there is no separate histogram of the difference. So in MT5 a "crossover" is when the bars cross the dotted line. The maths of the MACD line is the same; only the display differs, and some traders add a custom MACD with a histogram from the MT5 Market for the classic look.

On the MT5 mobile app, open the chart, tap the f (indicators) icon, choose MACD and confirm the settings. You can also add MACD on Xellion's WebTrader.

Not set up yet? Our MT5 download and login guide shows how to log in to the Xellion-Live server on phone, PC or web, and the platforms page covers MT5, the Xellion app and WebTrader.

Combining MACD with other indicators

MACD works best as one part of a plan. Common combinations:

  • MACD + moving averages: use a 50 or 200 EMA on the price chart for trend direction, and take MACD crossovers only in that direction. See moving average trading.
  • MACD + RSI: MACD shows momentum direction, while RSI shows whether price looks stretched (overbought or oversold). When both agree, the signal is cleaner. Our RSI indicator guide explains how.
  • MACD + Bollinger Bands: a MACD crossover as price returns from an outer band can mark the end of a pullback. See the Bollinger Bands guide.
  • MACD + price levels: a crossover at a support or resistance level means far more than one in the middle of nowhere.

Avoid stacking many similar indicators. MACD, the stochastic and RSI all measure momentum from the same prices, so three of them agreeing is not three separate confirmations.

A simple MACD trade plan (example)

Here is how a trader might use the MACD indicator on EUR/USD, as an illustration only:

  1. Trend: on the daily chart, price is above the 200 EMA – the trader looks only for buys.
  2. Setup: on the H4 chart, price pulls back to a support zone near 1.0800. MACD falls below zero.
  3. Trigger: a bullish MACD crossover forms below zero and the histogram turns positive. A bullish candle closes at 1.0815.
  4. Exit plan: stop below the support zone at 1.0790 (25 pips); target the recent high at 1.0890 (75 pips).
  5. Size: with a $500 account and a 1% limit per trade, the most to lose is $5. At about $10 per pip for 1.00 lot: $5 ÷ (25 pips × $10) = 0.02 lot.

Our guide to forex lot size and pip value explains the formula, and the position size calculator and pip calculator do the maths for you. A setup like this can still lose – MACD improves the odds of reading momentum correctly; it does not remove the chance of a losing trade.

Common MACD mistakes

  • Taking every MACD crossover · What happens: Many false signals, especially in ranges · Fix: Trade crossovers only in the higher-timeframe trend
  • Using MACD in a sideways market · What happens: Lines tangle around zero · Fix: Check for a clear trend first
  • Treating divergence as an entry · What happens: Entering too early while the trend continues · Fix: Wait for a crossover or price confirmation
  • Over-tweaking the settings · What happens: Settings fit the past, fail in the future · Fix: Start with 12, 26, 9
  • Ignoring news · What happens: Data releases push straight through signals · Fix: Check the economic calendar first
  • Comparing MACD values across markets · What happens: Numbers mean nothing outside their own chart · Fix: Compare MACD only with its own history

Timing matters too. MACD signals during quiet hours are often weak. The London and New York sessions usually give cleaner moves – see forex market timings in IST – and our economic calendar guide explains which releases move the market.

Practise MACD first, then go live

The best way to learn the MACD indicator is to scroll back through past charts and note every crossover, histogram turn and divergence – and what price did next. A free demo account lets you add MACD, test settings and practise trade plans without real money.

When you are ready:

  1. Choose Standard ($50 minimum, spreads from 0.9, no commission), Raw Spread ($250, from 0.1 plus $3.50 per lot per side) or Zero Spread ($750, from 0.0 plus $5.50 per lot per side) on the accounts page.
  2. Deposit by UPI (instant, from $50), bank transfer (within 1 business day, from $100) or crypto (USDT, BTC or ETH, from $10) – see the funding page. Bank withdrawals are listed at about 15–20 minutes.
  3. Trade on MT5, the Xellion app for iOS and Android, or WebTrader. Leverage goes up to 1:2000, but higher leverage does not change how much you gain or lose per pip – your lot size does. The margin calculator shows the margin for any position.

New to forex? Start with what is forex trading and how to start forex trading in India.

CFDs are complex instruments and carry a high risk of losing money. Not investment advice.

What is the MACD indicator?

MACD (Moving Average Convergence Divergence) is a momentum indicator that shows the difference between a 12-period and a 26-period EMA, plus a 9-period signal line and a histogram.

What do the MACD settings 12 26 9 mean?

12 is the fast EMA, 26 is the slow EMA, and 9 is the EMA used to smooth the MACD line into the signal line. They are the default settings on almost every platform.

What is a MACD crossover?

A bullish MACD crossover is when the MACD line crosses above the signal line; a bearish one is when it crosses below. Crossovers work best in the direction of the main trend.

How do I read the MACD histogram?

The histogram shows MACD minus the signal line. Growing bars mean momentum is increasing; shrinking bars mean it is slowing, even if price is still moving the same way.

What is MACD divergence?

Divergence is when price makes a new high or low but MACD does not. It warns that momentum is fading, but it is not a signal to enter on its own.

How do I add MACD in MT5?

Go to Insert → Indicators → Oscillators → MACD, keep 12, 26, 9 and Apply to Close, then click OK. In MT5 the MACD line shows as bars and the signal line as a dotted line.

Is MACD better than RSI?

Neither is better – they measure different things. MACD tracks momentum and trend direction; RSI shows whether price looks overbought or oversold. Many traders use both together.

This article is general information and education, not investment advice. CFDs are complex instruments and carry a high risk of losing money rapidly due to leverage.

Ready to put it into practice?
Open an account in minutes, or practise on a free demo first.

Risk warning: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money. Blog articles are general information and education, not investment advice. Risk disclosure