ResearchEquity Strategy
MACD: Calculation, Interpretation, and False Signals
Chapter 11 · Stock Research from First Principles
- Report or archive date
- Archive placement August 17, 2026
- Reading time
- 21 min read

Summary
MACD transforms two exponential moving averages into a measure of their separation. A second smoothing step creates a signal line, and a subtraction creates the histogram. Understanding those three operations is more useful than memorizing a list of bullish and bearish shapes.
MACD transforms two exponential moving averages into a measure of their separation. A second smoothing step creates a signal line, and a subtraction creates the histogram. Understanding those three operations is more useful than memorizing a list of bullish and bearish shapes.
MACD stands for Moving Average Convergence/Divergence. Use the standard 12, 26, and 9 settings to calculate the indicator at the close. The charts and worked closing-session example use NVIDIA (NVDA) daily prices from 2024.
1 Build the indicator from three calculations
The MACD line is the 12-period EMA of price minus the 26-period EMA of price. The signal line is a 9-period EMA of the MACD line. The histogram is the MACD line minus the signal line.
MACD = EMA(12) − EMA(26)
Signal = EMA(9) of MACD
Histogram = MACD − Signal
“Period” follows the chart interval. On a daily close series, the inputs are daily observations. On a weekly chart, the same settings refer to weeks. A 12-period line is therefore not automatically a 12-day line on every display.
The histogram is not trading volume. Its bars show the signed distance between two indicator values. A positive bar means MACD is above its signal line; a negative bar means it is below. Bar height must correspond to that difference using a clearly labeled axis.
Keep the four price-derived quantities distinct
The calculation begins with two price averages, then forms their difference, then smooths that difference. The signal line is not a nine-period moving average of the stock price. Applying the nine-period EMA directly to price would produce a different series measured at the price level, usually far from the MACD values being compared.
The histogram adds no independent price observations. It rearranges the relationship between MACD and its signal so that their separation is easier to see. Reading both a crossing of the lines and the histogram changing sign as two independent confirmations would count the same event twice. The two displays are useful representations of one relationship.
Write the data flow in order: closing price updates both price EMAs; their difference creates the current MACD; the current MACD updates the signal; subtracting the updated signal creates the histogram. Each stage uses the output of the previous stage at the same observation time. This order prevents an accidental one-session delay caused by updating the signal with yesterday's MACD.
2 Review the EMA update before combining it
For an N-period EMA using the common convention, alpha = 2 ÷ (N + 1). The updated average is the prior EMA plus alpha times the difference between the new price and the prior EMA. Thus the 12-period alpha is 2/13, the 26-period alpha is 2/27, and the 9-period signal alpha is 2/10, or 0.2.
The shorter average responds more strongly to a new price because its alpha is larger. When recent prices rise persistently, the shorter average often sits above the longer one, producing positive MACD. When recent prices weaken, the relationship can reverse.
The word often matters. The result depends on the entire recent sequence and the starting conditions. A single rising close can coexist with negative MACD if the shorter average remains below the longer average after an earlier decline.
The faster average is a weighting rule, not a speed forecast
The 12-period alpha is approximately 0.153846, while the 26-period alpha is approximately 0.074074. For an equal gap between a new price and each prior average, the shorter EMA would move more than twice as much toward the new observation. In an actual series, however, the two prior averages usually differ, so the gaps being multiplied also differ. Do not predict the exact MACD change from the two alpha values alone.
Consider a separate state with prior EMA12 of 50 and prior EMA26 of 49. A new close of 52 updates EMA12 to approximately 50.307692 and EMA26 to approximately 49.222222. MACD becomes approximately 1.085470. If the prior signal is 0.8, the new signal is approximately 0.857094 and the histogram is approximately 0.228376. These stipulated states teach one update; they are not taken from the NVDA dataset.
The full historical calculation needs every preceding state or a defined initialization and complete input history. Substituting a convenient starting value near the left edge can change early crossings. The extensive pre-chart history used for the actual figures prevents the visible July boundary from becoming an arbitrary reset of the indicator.
3 Calculate one real closing-session update
Use NVIDIA's September 3, 2024 closing price of $108.00. The previous trading session was August 30. Its 12-period EMA was approximately 122.301184, its 26-period EMA was 120.187028, and its signal line was 2.103284. These prior states are calculated from the preceding daily history, not stipulated starting values.
Update each price average with the new close. The 12-period calculation is EMA12(previous) + (2/13) × [108.00 − EMA12(previous)] ≈ 120.101002. The 26-period calculation is EMA26(previous) + (2/27) × [108.00 − EMA26(previous)] ≈ 119.284285.
Subtract the updated averages to obtain MACD ≈ 0.816717. Then update the signal: Signal(previous) + 0.2 × [MACD(current) − Signal(previous)] ≈ 1.845970. The histogram is MACD(current) − Signal(current) ≈ -1.029253. All calculations retain full precision; displayed values are rounded.
| Quantity | Aug 30, 2024 | Sep 3, 2024 |
|---|---|---|
| 12-period EMA | 122.301184 | 120.101002 |
| 26-period EMA | 120.187028 | 119.284285 |
| MACD | 2.114156 | 0.816717 |
| Signal | 2.103284 | 1.845970 |
| Histogram | 0.010873 | -1.029253 |
The histogram changed from slightly positive to negative while MACD remained above zero. Those observations are compatible: the shorter price average was still above the longer average, but their separation was now smaller than its smoothed signal.

Reconcile the historical update in separate checks
First check that each new EMA moves toward the $108 close by the fraction specified by its alpha. Both prior averages were above $108, so both must decline. Second, subtract the updated slow average from the updated fast average. The result remains positive because the fast average still exceeds the slow average. Third, compare current MACD with the prior signal to determine the direction of the signal update. Since current MACD is lower, the signal declines too.
Finally, subtract the updated signal from current MACD. MACD is now below the signal, so the histogram must be negative. These directional checks do not replace the arithmetic, but they can expose a reversed subtraction or a mismatched time index before a chart is drawn.
The displayed six-decimal prior states are rounded versions of the internal calculation. Recomputing from the displayed table can produce a tiny last-digit difference from the stored full-precision sequence. That is a display limitation, not permission for large discrepancies. Preserve full precision through the calculation and use one documented rounding convention for the table and chart labels.
4 Keep zero-line and signal-line events separate
A zero-line crossover occurs when MACD changes sign. Because MACD is the difference between the two price EMAs, this corresponds to a change in their ordering. A positive MACD means the short EMA is above the long EMA.
A signal-line crossover occurs when MACD moves from one side of its signal line to the other. This can happen while both lines remain above zero or while both remain below zero. It describes a different relationship from the zero-line crossing.
For example, MACD can rise from −2.0 to −1.5 while the signal is −1.8. MACD remains negative but is above the signal, so the histogram is +0.3. The recent negative separation between the price averages has narrowed enough to exceed its smoothed reference. That is not the same as the short price average already being above the long one.
Likewise, MACD of +2.0 and signal of +2.4 produce a −0.4 histogram. The short price average is still above the long average, while MACD is below its own signal. Describe both facts instead of reducing every state to a single buy or sell label.
On August 30, NVDA MACD was 2.1142 and its signal was 2.1033. By the September 3 close, MACD had fallen to 0.8167, below the signal at 1.8460 but still above zero. The negative histogram of −1.0293 marks a signal-line crossing, not a zero-line crossing. The magnified chart uses the same historical calculation as the full-period chart.

Read all four sign combinations
Two questions organize the indicator state: is MACD above or below zero, and is the histogram above or below zero? Positive MACD with a positive histogram means the fast price average exceeds the slow average and MACD exceeds its smoothed signal. Positive MACD with a negative histogram retains the first relationship while reversing the second.
Negative MACD with a positive histogram means the fast price average remains below the slow average, but MACD is above its signal. Negative MACD with a negative histogram places it below both zero and its signal. These four descriptions are arithmetic states, not four predetermined future outcomes. At an exact zero, state equality separately instead of forcing the observation into a positive or negative category.
An event also requires a prior observation. A positive histogram today does not prove that an upward signal-line crossing happened today; the histogram may have been positive for many sessions. A crossing rule compares the current and prior relationships under its stated equality convention. Keeping states and transitions separate avoids counting every positive bar as a new signal.
5 Read the actual historical sequence
The chart shows NVIDIA's 87 trading sessions from July 1 through October 31, 2024. Each candle uses that session's open, high, low, and close. Candle color compares the close with the open; gaps between sessions remain visible. The lower panels plot MACD, its signal, and their signed difference from those same daily closes.
Prices use consistent post-split share units and are not adjusted for cash dividends. The indicator history begins on January 3, 2023, giving 374 earlier trading observations before the displayed interval. Each price EMA starts at that first close, and the signal starts at the initial MACD of zero. Earlier observations are retained in the calculations even though they are outside the displayed window.
The horizontal axis advances by trading session. Weekends and exchange holidays are omitted rather than filled with prices. MACD and the histogram use dollar units; their vertical axes are labeled independently. Equal calendar intervals can therefore contain different numbers of plotted sessions.
| Date | Close ($) | MACD ($) | Signal ($) | Histogram ($) |
|---|---|---|---|---|
| 2024-07-01 | 124.30 | 5.2701 | 6.8962 | -1.6261 |
| 2024-07-10 | 134.91 | 4.8445 | 5.2027 | -0.3582 |
| 2024-08-05 | 100.45 | -4.2691 | -2.2261 | -2.0430 |
| 2024-08-30 | 119.37 | 2.1142 | 2.1033 | 0.0109 |
| 2024-09-03 | 108.00 | 0.8167 | 1.8460 | -1.0293 |
| 2024-09-06 | 102.83 | -2.1713 | 0.2764 | -2.4477 |
| 2024-10-21 | 143.71 | 5.6348 | 4.4810 | 1.1538 |
| 2024-10-31 | 132.76 | 4.1626 | 5.0274 | -0.8648 |
The sequence includes declines, rebounds, gaps, and reversals of different sizes. On September 3, the close fell from the prior session's $119.37 to $108.00. MACD moved below its signal while remaining positive. By September 6, MACD itself was negative. These are separate observations on separate dates, not two names for one crossing.
On October 21, the close was $143.71 and the histogram was positive at approximately 1.1538. On October 31, the close was $132.76 and the histogram was negative at approximately −0.8648, while MACD remained positive at 4.1626. Read the price, the sign of MACD, and its position relative to the signal separately. The panels record what happened; they are not a trading-performance test.

Compare the panels at the same observation
Choose a date label and read vertically through the price, MACD, and histogram panels. All three must refer to the same trading session. A one-row offset can produce an apparently plausible chart while assigning an indicator response to the wrong price. The historical examples use daily closes for the calculations and actual daily OHLC observations for the candles.
The histogram's bar height should equal the signed difference between the two lines, expressed on its own labeled scale. It should not be enlarged merely because a crossing is narratively interesting. On August 30, the positive histogram is very close to zero. A small bar is the correct representation; making it prominent would exaggerate the measured separation.
Independent panel scales help reveal detail, but they also prevent direct comparison of raw visual heights across panels. A tall histogram bar is not a larger dollar movement than a short candle simply because it occupies more screen space. Read the units and limits. The values in the accompanying table provide checkpoints for testing whether the visual and numerical descriptions agree.
6 MACD is measured in price units
Standard MACD is a difference between price averages, so it has the same units as the input price. A MACD value of 2 on a $20 stock is not directly comparable with 2 on a $200 stock. The relative separation is very different.
If every price in a series is multiplied by ten and initialization is scaled consistently, the EMA values, MACD, signal, and histogram also multiply by ten. The underlying percentage pattern is unchanged. This scaling property explains why raw MACD magnitudes should not rank unrelated securities without normalization.
Percentage-based variants can address some cross-price comparison issues, but they are different indicators with their own formulas. Do not substitute one while retaining the other's axis label. The same care applies to currencies and split adjustments.
A percentage normalization changes the question
In a comparison, one stock has a fast EMA of 22 and a slow EMA of 20, while another has a fast EMA of 202 and a slow EMA of 200. Both have raw MACD of 2. Relative to the slow average, their separations are 10% and 1%, respectively. Equal dollar differences do not imply equal proportional momentum.
A percentage price oscillator can express such a separation as a percentage under its specified formula. It should be named and calculated as that indicator rather than relabeling standard MACD numbers with a percent sign. Smoothing and signal construction also need the relevant definition. A familiar-looking chart can represent a different calculation when its denominator changes.
Consistent multiplicative rescaling of a price series preserves the timing of MACD crossings while scaling all its values. Inconsistent corporate-action treatment does not. If only part of the price history changes units at a split, the resulting artificial discontinuity can generate a large false indicator movement. That is a data problem to repair before interpretation, not a particularly strong market signal.
7 Divergence is a description that needs a rule
A divergence is often described when price reaches a new high while an indicator fails to exceed its prior high, or when price reaches a new low while the indicator does not. This can suggest a change in the pace of movement. It does not establish when or whether price will reverse.
Define the peaks used in the comparison. Selecting them after seeing the full chart introduces hindsight. If a peak requires later observations to confirm it, the event was not known at the peak itself. A test must delay recognition until the required information is available.
The historical chart also shows why visual impressions need numerical definitions. A shrinking histogram means MACD and its signal are moving closer together. It does not, by itself, identify a price peak or establish bearish divergence. First specify which price peaks and which indicator observations are being compared.
When recording a divergence hypothesis, write the exact observations, recognition date, proposed consequence, and invalidating condition. A shape that can be redefined indefinitely after price moves is difficult to evaluate honestly.
Define contraction using magnitude and sign
The word shrinking can be ambiguous for a signed histogram. A change from −2 to −1 is an increase in its numerical value but a decrease in its absolute magnitude. The negative gap between MACD and its signal has narrowed. A change from +2 to +1 is a decrease in both numerical value and magnitude. The positive gap has narrowed. Both move toward zero, but from different sides.
Likewise, an expanding negative bar from −1 to −2 has greater magnitude while its numerical value falls. Describe direction and magnitude explicitly when the distinction matters. A claim that the histogram is rising should identify whether it means a higher signed value or a taller bar measured away from zero.
The signal formula gives another useful check. With alpha 0.2, current signal equals 0.8 times the prior signal plus 0.2 times current MACD. Therefore current histogram equals 0.8 times the difference between current MACD and the prior signal. This algebra explains why using the prior signal directly for the displayed histogram would overstate the current gap under this convention. The current signal must be updated first.
8 Sideways markets create repeated crossings
MACD is built from moving averages, so it inherits their lag and sensitivity to reversals. When price oscillates around a stable level, the faster average repeatedly responds before the slower one. Signal crossings can occur without a durable trend developing.
A strategy that acts on every crossing may incur many trades and costs. Reducing sensitivity can lower turnover while delaying genuine transitions. Adding a second price-derived indicator may repeat much of the same information rather than independently confirming it.
Evaluate the rule across trending, range-bound, and abrupt-gap conditions. Record average trade size, turnover, costs, and time spent invested. A favorable-looking indicator panel is not a performance test. The test requires an executable rule and a complete return series.
9 Respect the information clock
An intraday MACD value can change before the period closes. A crossing visible halfway through a session may disappear by the final close. If the rule requires closed-period confirmation, do not count an unfinished observation as a completed signal.
If the rule uses the closing MACD and executes at the next open, the next price may be very different. A gap can erase an apparent advantage or produce a larger loss than expected. Include that possibility in paper examples instead of assuming every crossing can be traded at the exact chart intersection.
Parameter testing also needs discipline. Trying many combinations of fast, slow, and signal periods creates opportunities to fit noise. Preserve the development history and assess settings on data not used to choose them. A familiar default is a convention, not evidence that it is optimal for every security.
Do not translate one interval into another by relabeling it
A weekly MACD is calculated from a weekly input series. It is not obtained by displaying every fifth point from a daily MACD and changing the label to weekly. A twelve-week EMA uses twelve-week smoothing conventions and weekly observations; a twelve-day EMA retains a different distribution of information. Their crossings can occur at different times without either calculation being wrong.
If a research process uses both daily and weekly context, record when each observation becomes final. A completed daily close can coexist with an unfinished weekly bar. Using the final value of that week while simulating a decision made on Tuesday would introduce future information. A live weekly indicator can be monitored, but it must be labeled as provisional until the required period ends.
The same discipline applies to rule testing. Specify whether a daily signal must agree with the last completed weekly signal or with a changing current-week estimate. Those are distinct rules. A backtest must reproduce the information actually available at each decision time rather than selecting whichever version produces the most favorable historical entry.
10 Combine price context with business research
MACD does not measure earnings quality, competitive advantage, debt maturity, or valuation. Those questions remain with the earlier chapters. An improving indicator cannot repair an unsupported business thesis, and a deteriorating indicator does not alone establish that the business has lost value.
A useful research note might say that the stock's recent price momentum has weakened while the operating assumptions remain unchanged, or that a negative earnings revision coincides with weaker price behavior. The note should identify the independent evidence in each statement rather than treating the chart as proof of the financial conclusion.
For a beginner's paper study, the best initial objective is correct interpretation. State the sign of MACD, its position relative to the signal, and whether the gap is expanding or contracting. Then state what those observations do not establish.
11 Exercises
A. The 12-period EMA is 54 and the 26-period EMA is 52.5. The signal line is 1.2. Calculate MACD and the histogram.
B. MACD is −0.8 and signal is −1.1. Is the histogram positive or negative? Is MACD above or below zero?
C. MACD rises from 2.0 to 2.1 while signal rises from 1.5 to 1.8. Calculate the old and new histograms. Explain the result.
D. Prior signal is 0.4 and new MACD is 0.9. Update a 9-period EMA signal using alpha of 0.2.
E. Every input price is multiplied by five. What happens to standard MACD and its histogram if initialization is also scaled?
F. A proposed divergence is identified using a peak that requires three later closes to confirm. When can a rule legitimately recognize that peak?
G. Why can a negative histogram coexist with a positive MACD?
H. Write a three-sentence interpretation of the September 3, 2024 NVDA close without making a guaranteed prediction. Exercise H refers to the historical case.
12 Answers and interpretation checks
A. MACD is 54 − 52.5 = 1.5. Histogram is 1.5 − 1.2 = 0.3. The shorter price EMA is above the longer one, and MACD is above its signal. Neither arithmetic relationship guarantees a subsequent gain.
B. Histogram is −0.8 − (−1.1) = +0.3. MACD is above its signal but remains below zero. This combination demonstrates why a signal-line crossing and a zero-line crossing must be described separately.
C. The old histogram is 0.5 and the new histogram is 0.3. MACD rose, but its signal rose more, narrowing the difference. A declining histogram is not equivalent to a declining price or even a declining MACD line.
D. Updated signal is 0.4 + 0.2 × (0.9 − 0.4) = 0.5. The resulting histogram is 0.9 − 0.5 = 0.4. The new MACD enters the current signal update; using the old MACD would create a different timing convention.
E. Both multiply by five because the EMA and subtraction operations are linear under the same scaling. Crossings retain their timing, but numeric magnitudes change. Raw MACD values therefore depend on the price scale.
F. Recognition occurs only after the third confirming close becomes available. Acting at the original peak would use later information. The execution assumption must begin after recognition, subject to the actual order method.
G. Positive MACD means the shorter price EMA exceeds the longer one. A negative histogram means MACD is below its signal. These compare different pairs of quantities and can occur together without contradiction.
H. One answer is: “At the September 3, 2024 close, NVDA MACD is positive at approximately 0.8167 but below its signal at 1.8460. The histogram is therefore negative, approximately −1.0293, following a close of $108.00. This is a signal-line crossing while MACD remains above zero; it does not establish the next price move.”
Integrated workshop: a falling MACD with a positive histogram
Use a separate starting state: MACD is 1.0 and its signal is 0.8. At the next observation, MACD falls to 0.9. Update the signal using alpha 0.2, then calculate the histogram. At the following observation, MACD falls to 0.7. Repeat the calculation without resetting the signal.
The first updated signal is 0.8 + 0.2 × (0.9 − 0.8) = 0.82. The histogram is 0.9 − 0.82 = 0.08. MACD fell, but it remains positive and above its signal. At the following observation, the signal is 0.82 + 0.2 × (0.7 − 0.82) = 0.796. The histogram becomes 0.7 − 0.796 = −0.096. A signal-line crossing has occurred while MACD remains above zero.
The example makes three distinctions visible. The direction of MACD is different from its sign. Its position relative to the signal is different from its position relative to zero. The histogram is a derived difference, not an independent vote on the stock. A sentence such as “the indicator turned negative” would be ambiguous here unless it named the histogram specifically.
For the NVDA charts, calculate the indicators from the full series of archived closing prices. Indicator levels alone do not determine a trading return.
Test the implementation with simple limiting cases
To check the calculation, hold the price at a positive constant. Initialize both price EMAs at that price and the signal at zero. The MACD line, signal line, and histogram should all stay at zero. If any value changes, check the starting values, the date assigned to each observation, and the order of subtraction.
Multiplying every input price and the initial states by a positive constant should multiply every output by the same constant. The dates of zero and signal-line crossings should remain unchanged. This check can expose a hidden mixture of adjusted and unadjusted prices or an inconsistent state. A chart may appear plausible despite such a mixture, so numerical properties are valuable safeguards.
At every observation, subtracting the signal from MACD must reproduce the stored histogram. The displayed sign should agree with that subtraction, and bar magnitude should reflect its absolute size on the stated axis. A negative value of −0.01 should not be drawn with the same height as −1.00. A near-zero crossing may deserve explanatory text, but its visual size must remain faithful to the data.
These checks address calculation consistency. They do not establish that acting on the indicator is profitable. That separate question requires actual returns, execution assumptions, costs, and a fair comparison over an appropriate sample.
A zero-line crossing can arrive after a substantial move
Because the indicator compares two smoothed price histories, a zero-line crossing can occur after the stock has already advanced or declined materially. The crossing records the point at which the fast EMA changes order relative to the slow EMA. It does not identify the beginning of a move with hindsight-free precision.
A researcher should therefore avoid describing every subsequent gain as captured by a crossover rule. The rule's entry becomes possible only after its specified recognition time, and the executable price may differ from the plotted close. Gains before that point belong to the historical price path, not to the strategy. The same applies to losses occurring before a delayed exit.
Slower settings may reduce some rapid reversals while increasing delay. Faster settings may respond sooner while producing more short-lived events. Neither tradeoff can be resolved by choosing the line that best matches one completed chart. A useful comparison holds the evaluation method constant and examines the consequences across different conditions.
Write a complete interpretation in three layers
First describe the price evidence: the relevant close, interval, and adjustment basis. Second describe the indicator state: the sign of MACD, its position relative to its signal, and the direction or magnitude of the gap. Third state the research implication within its limits: what the observation suggests investigating and what it cannot establish about the business or the next price move.
For the September 3 historical example, the first layer is the $108 close after the preceding session's $119.37. The second is positive MACD below its signal, producing a negative histogram. The third is a documented weakening in this price-derived relationship, with no automatic conclusion about future profitability or the business's intrinsic value. Keeping the layers separate makes the note both precise and readable.
The same structure works when the evidence improves. A positive histogram can be reported accurately without a promise of gains, just as a negative histogram can be reported without declaring the company impaired. Technical analysis becomes more useful when its language stays as specific as its arithmetic.
13 Keep the calculation ahead of the example
For any future MACD diagram, preserve the input closes, smoothing settings, initialization, and unrounded outputs. The histogram bars must be drawn from MACD minus signal rather than sketched to suggest a story. The next chapter applies the same discipline to RSI and the problem of apparently independent confirmation.
Related research
ResearchEquity Strategy
Use Moving Averages Without Mistaking Lag for Foresight
A moving average compresses a sequence of prices into a smoother line. It can help describe direction and reduce the visual distraction of individual observations. It cannot know tomorrow's price, and the smoothing that makes it easier to read also creates delay.
ResearchEquity Strategy
RSI, Volume, and the Limits of Confirmation
RSI compares the smoothed size of recent upward price changes with recent downward changes. Its bounded scale makes the result easy to display, but labels such as overbought and oversold are often interpreted more strongly than the calculation supports.
ResearchEquity Strategy
Learn Price Charts, Volume, and Adjusted Data
A price chart is a record produced from data choices. Its appearance depends on the trading interval, the price field, the scale, and the treatment of corporate actions. Before interpreting a pattern, establish what the chart actually measures.



