In this article
After this article, you can
- Recognise unit-driven changes in raw MACD values.
- Separate numerical scale from indicator relationships.
Terms at hand: Exponential Moving Average (EMA) · Trading Journal · Stop loss · Take profit (TP) · Short position · Long position (bullish position)
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.
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.
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
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.
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
- 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.
- 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.
- 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.
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
Check your understanding
One short exercise
About 2 min · you can try again
All prices and EMA states are multiplied by100; M rises from2 to200. What follows?
- Same state in another unit, not evidence of a stronger market.
- Profit probability increased100 times.
- The histogram must reverse sign.
Check the answer and explanation
Same state in another unit, not evidence of a stronger market.
The average difference also scales by100; no observations or relationships changed.
Frequently asked
What exactly is MACD and who invented it?
MACD means Moving Average Convergence Divergence. TradingView’s documentation attributes it to Gerald Appel; this article does not rely on an unverified exact development year. A common variant uses M = EMA(12, Close) − EMA(26, Close), S = EMA(9, M) and H = M − S. Check the implementation: the built-in MT5 signal is SMA(9, M), and its bars plot M. TradingView allows changes to source and average types, so “12, 26, 9” alone does not fully identify two matching calculations.
What is MACD divergence and what does it establish?
Regular divergence compares selected price pivots with corresponding pivots in a named series. For example, hypothetical EUR/USD highs of 1.1000, 1.1050 and 1.1080 paired with successively lower M highs would meet that description. Lower M highs do not automatically imply lower H highs: H also depends on S. The pattern does not count buyers or guarantee that price will turn. State the pivot-confirmation rule and use the time at which those pivots become known when evaluating a trade.
Does MACD work on M5 for scalping?
MACD can be calculated on M5, where its periods count five-minute candles. Its moving averages use historical inputs, but the formula does not specify a universal delay of several bars or establish that another indicator is better for scalping. Specify the data, initialisation, event and execution rules; then compare net results including spread, commissions and slippage on a documented sample. A signal on a still-open candle may change before the close.
How to combine MACD with other indicators?
Define a combination as a testable rule rather than a proven sequence. An example might require price above a specified D1 moving average, an H4 pullback to a defined level, and an upward M/S crossing on a completed bar. State how the level, pullback and any RSI condition are calculated, and when the D1 candle is known. Adding conditions can change which trades are admitted and their timing; it does not itself prove higher profitability or a lower number of executable trades.
Sources & bibliography
-
Investopedia MACD Indicator Explained · An introductory explanation of the MACD indicator. www.investopedia.com ↗
-
CFA Institute CFA Institute research portal · The CFA Institute research portal provides access to investment research. www.cfainstitute.org ↗
-
Gerald Appel Technical Analysis: Power Tools for Active Investors · Appel's book discusses technical-analysis tools, including MACD. www.amazon.com ↗
-
MetaQuotes MetaTrader 5 Help — Moving Average Convergence/Divergence · The built-in MT5 calculation uses EMA12−EMA26 for the main value and SMA9 for the signal; this differs from the chosen EMA-signal model. www.metatrader5.com ↗
-
TradingView Moving Average Convergence Divergence (MACD) indicator · Main, signal and histogram relationships, configurable source and average types, and completed-timeframe input; no universal profitability ranking is established. www.tradingview.com ↗
-
Fidelity Technical Indicator Guide — MACD · The common EMA12/EMA26/EMA9 construction and unbounded indicator scale. The article’s recursive sequences and trade fills are hypothetical. www.fidelity.com ↗
Go deeper · the complete guide
Momentum trading — how to trade trend strength — Explore a separate momentum-strategy prototype with an explicit movement measure, entry, exit and after-cost test.
More in Technical analysis →