MACD measures relationships between smoothed prices. A line crossing its signal and a line crossing zero are different observations.
Name all three quantities
The usual 12/26/9 convention subtracts EMA26 from EMA12 to form the MACD line, smooths that difference with EMA9 for the signal line, and plots their difference as the histogram. The result is in price units, not a bounded percentage like RSI. An absolute MACD value is therefore not directly comparable between differently priced securities.
Fidelity’s definition is the background reference. Our downloadable example fixes the seed and histogram scale explicitly so a reader can reproduce the arithmetic. It is an educational implementation, not a claim that every chart platform initializes its calculation identically.
Background source: Fidelity: MACD definition and calculation
Keep the warm-up and seed visible
For this file, an n-period EMA starts with the simple average of its first n closes, then updates as previous EMA + [2/(n+1)] × (new close − previous EMA). EMA12 first exists at bar 12 and EMA26 at bar 26. The first valid MACD is therefore bar 26.
The signal starts with the average of the first nine valid MACD observations, so it first exists at bar 34. The CSV keeps earlier cells blank. A platform using more history or another seed can produce different early values. Compare settings and enough shared history rather than replacing blank warm-up cells with zeros.
Reproduce bar 35 by hand
The first 34 closes are 100, then bar 35 closes 110. Before the change both EMAs are 100 and MACD and signal are zero where valid. EMA12 becomes 101.53846154 and EMA26 becomes 100.74074074. MACD is 0.79772080.
Signal EMA9 moves 20% of the way from 0 to that MACD, becoming 0.15954416. The histogram is 0.63817664, rounded for display. This is MACD minus signal, with no factor of two. Some displays scale their histogram differently; a double-height column does not itself mean the market momentum doubled.
| Bar35 quantity | Value | Convention |
|---|---|---|
| EMA12 | 101.53846154 | SMA-seeded EMA |
| EMA26 | 100.74074074 | SMA-seeded EMA |
| MACD | 0.79772080 | EMA12 − EMA26 |
| Signal | 0.15954416 | EMA9(MACD) |
| Histogram | 0.63817664 | MACD − signal, no2x |
Separate a signal crossover from a zero crossing
When MACD rises above the signal, the histogram changes from negative to positive under this convention. MACD may still be below zero, meaning EMA12 remains below EMA26. When MACD itself crosses zero, the two underlying EMAs have become equal at that crossing.
Neither event specifies an execution price, holding period or acceptable loss. In a sideways sequence, repeated crossovers can alternate quickly. The plotted series shows a rise followed by a decline; use it to identify the line relationships, not to select only the crossover that looks successful afterward.
Read a shrinking histogram without inventing a reversal
A positive but shrinking histogram says the MACD line is approaching its signal under the chosen settings. Price can still rise while that happens. A divergence compares defined price and indicator turning points; it does not establish when a reversal will occur or whether it will occur at all.
Use completed bars and the same interval. A daily crossover can coexist with an opposing intraday observation. Before testing a rule, specify which bar confirms it and what future price you could actually trade; entering at a historical close known only after the close can introduce an unrealistic assumption.
Use the indicator as one input in a written scenario
Write the price context, what MACD adds, the evidence against the idea and the invalidation plan. RSI also uses the closing-price path, so agreement is not two independent confirmations. Volume can add a different observation about activity, but it does not prove a trade will work.
The CSV contains the full sequence and intermediate values. It is not an upload format for DividenNote or an automated signal feed. No win rate or optimal parameter is claimed for these invented bars.
Download the learning data and worksheets
Put it into practice
Compare the actual lines and the CSV warm-up cells, then learn what RSI measures differently.
Read the RSI example