A MACD crossover compares two indicator values; it does not record an order, a change in buyer numbers or a future price move. This guide separates the MACD line, its signal and their difference, then works through a small numerical sequence. The platform implementation matters: the built-in MT5 MACD differs from the EMA-signal version used in the first model.

What is MACD made of?

For the first model, M = EMA(12, Close) − EMA(26, Close), S = EMA(9, M), and H = M − S. The table below describes this chosen classic variant. TradingView lets users select the price source and moving-average types. In the built-in MT5 indicator, the signal is SMA(9, M), and the plotted bars represent M itself, rather than H. The MQL5 interface provides a main buffer and a signal buffer; calculate their difference separately if that is the series you need.

The parts of MACD in the 12, 26, 9 setting
MACD linethe difference between two exponential averages: the 12-period EMA minus the 26-period EMA
Signal linea 9-period EMA calculated from the values of the MACD line itself
Histogrambars showing the gap between the MACD line and the signal line
Zero linethe level at which the two exponential averages are equal

MACD above zero means the fast EMA exceeds the slow EMA. A positive histogram means MACD exceeds its signal line; it does not mean the gap is currently growing or that price must be rising. Distinguish the histogram's sign from its change, and specify periods rather than assume they are weeks.

The line crossover — when does it mean anything at all?

The most frequently quoted signal is the MACD line crossing the signal line.

  • Upward crossover. Under a strict rule, the previous completed bar has H < 0 and the current completed bar has H > 0. This compares M with S, not M with zero. For example, M = −6 and S = −8 gives H = +2 even though M remains negative.
  • Downward crossover. The strict rule requires previous H > 0 and current H < 0. An intrabar crossing can disappear before the candle closes. Specify how exact zero values and displayed rounding affect the test.

Here is a hypothetical sequence in pips of EUR/USD moving-average difference, where one pip means 0.0001. It is not a complete price history or a backtest. Set M to 10, 11, 13, 12.5 and 10, with an explicitly given initial S of 12. For EMA(9), choose S(t) = 0.2 × M(t) + 0.8 × S(t−1). The successive S values are 12, 11.8, 12.04, 12.132 and 11.7056; H is −2, −0.8, +0.96, +0.368 and −1.7056. Strict crossings occur at t = 2 and t = 4 while M stays positive. At t = 3, H is positive but shrinking: its sign and its change answer different questions.

Divergence — compare specified price and indicator pivots

Regular divergence compares two selected price pivots with corresponding pivots in one specified indicator series. The following numbers are hypothetical. Use either M or H consistently, and state when a pivot becomes known: a rule requiring later candles cannot identify the pivot at the moment of its high or low.

Bullish divergence

  • Hypothetical EUR/USD price lows: 1.0700, then 1.0650, a fall of 50 pips.
  • Corresponding M lows: −0.0012, then −0.0008, a rise of 0.0004, or 4 pips of moving-average difference.
  • This is a lower price low paired with a higher M low. It describes the selected historical relationship; a reversal, its timing and a profitable trade do not follow from the label.

Bearish divergence

  • Hypothetical price highs: 1.1000, then 1.1080, a rise of 80 pips.
  • Choose corresponding M highs that decline. If you instead compare H highs, label the example as histogram divergence; a lower M high does not by itself prove that H also shrank.
  • The selected price highs rise while the selected indicator highs fall. This is a description of those pivots, not a count of buyers or a forecast of the next price.
Illustrative example — bearish divergence on EUR/USD (D1)
Hypothetical first high: price 1.0820, H +0.0015The chosen histogram reference; no complete OHLC history is supplied
Second assumed high two weeks later: price 1.0890, H +0.0008Price rises 70 pips; H falls by 7 pips of indicator difference
Assumed later buy-to-close Ask: 1.0750From a short sale at Bid 1.0890, the gross gain is 140 pips
Assumed short fill at Bid 1.0890 after recognition of the setupStop at Ask 1.0930: 40 pips of planned risk. Target fill at Ask 1.0750: 140 pips of gross reward. Reward/risk = 140/40 = 3.5.

Divergence and crossovers describe different relationships in historical data. Divergence can precede a reversal, persist or fail; this does not establish universally stronger performance than a crossover. Compare fully specified rules on a documented sample before making that claim.

A hundredfold MACD need not mean a stronger move

Change only the unit used to record identical data. MACD numbers change while indicator relationships stay the same.

Scroll sideways to see the full diagram

Quote units change MACD heightTwo identical MACD states in units differing by a factor of100: M2, S1.5, H0.5 and M200, S150, H50. Each panel has its own proportional scale.LARGER NUMBER, SAME INFORMATIONUnit AM 2S 1.5H 0.5A × 100M 200S 150H 50H=M−S: 0.5 and 50 in the new units.Every price and EMA state is scaled ×100.Signs and relationships remain unchanged.Bar size does not rank markets.

Fictional indicator state, no instrument ranking or future result. In unit A, EMA12=102, EMA26=100 and S=1.5. The second representation multiplies prices, both EMA states and signal state by100. Parameters and later updates are identical. Full initialization history is not shown. The document TradingView — MACD defines M as the average difference, S as an average of M, and H as M−S.

Panels deliberately use rescaled axes. The larger right-hand number results from multiplying the entire series by100, without adding information.

State the unit when comparing readings. M>0 and H>0 in both representations; H/S is equal. Changing units neither creates nor removes a crossover. Comparing different instruments requires another defined measure; raw M size alone does not supply one.

The histogram — how to read the strength of a move

For H = M − S, a positive value places M above S; a negative value places M below S. Neither is a count of participants or capital flows. In the built-in MT5 panel, first distinguish its main-value bars from a separately calculated H before interpreting their sign.

  • Growing bars. A widening histogram measures greater separation between MACD and its signal line. It does not by itself prove that a position should remain open; exits must follow the stated risk and strategy rules.
  • H reaches a local maximum. This is a maximum of M − S in the chosen comparison window. It is not automatically the strongest price move, and recognising a confirmed local maximum may require later bars.
  • H moves toward zero. The separation between M and S narrows. Read the signed values: a move from −2 to −1 is a rise in H even though the negative bar becomes shorter.

The divergence trade above assumes the stated Bid/Ask fills after the setup is recognised; it does not assume you can sell at a high that is identified only later. Fees are omitted, and an ordinary stop can fill worse than its requested level. Separately, multiplying all prices and initial moving-average states by 100 multiplies M, S and H by 100: M = 2, S = 1.5, H = 0.5 becomes 200, 150 and 50. Signs and crossings stay the same. MACD is unbounded and is not a percentage score.

Classic MACD traps

  1. Entering on every crossover. An event detector supplies a condition, not an order policy. Define the price trigger, permitted position state, costs and exit rules before treating events as trades.
  2. Assuming a timeframe is automatically best. On M5 the periods count five-minute candles; on H4 they count four-hour candles. The input history changes, but this alone establishes neither a fixed delay nor superior net performance on one timeframe.
  3. Ignoring the zero line. M > 0 means the fast average exceeds the slow one. An upward signal-line crossover can occur while M < 0, as in previous M = −5.5, S = −5.25 and current M = −4, S = −5. Here H changes from −0.25 to +1; it is not a MACD zero-line crossover.
  4. Treating MACD as the only criterion. The indicator does not know where support lies or what the next macro release will say about the market — all it computes is the difference between two averages. Before you build a system around indicators alone, it is worth reading whether indicators by themselves can generate consistent profit.
  5. Changing settings without documenting them. Record the price source, fast and slow average types, signal type, periods and initialisation. Compare a proposed change on data excluded from selecting it; a better historical fit alone does not establish future performance.

MACD transforms prices already received. It does not supply the tendency of the next few days. A useful record distinguishes an indicator state, a newly detected event and an executed trade.

What to do before you open a position on MACD

  1. Define the variant and completed bars. Record the source price and M/S/H formulas before comparing signals across platforms. If your rule uses a higher timeframe, wait for its required candle to close rather than using its changing provisional value.
  2. Record the actual event. Write down previous and current M, S and H, which zero convention you used, and whether M is above or below zero. Check that an event is newly detected rather than repeatedly counting an unchanged state.
  3. Put the indicator next to price and the calendar. Specify any price or calendar condition in advance. A scheduled release can change execution conditions; it does not algebraically erase an M/S crossing or guarantee its next result.
  4. Calculate the trade model before placing an order. Use the actual entry side, intended closing side, volume, account-currency conversion and fees. The 40-pip ordinary stop above is planned risk, not a guaranteed maximum loss; calculate a worse-fill case as well.