# MACD

MACD is a price-based momentum indicator that compares two exponential moving averages and uses a signal line to show changes in the strength and direction of a trend.

## What it means

Moving Average Convergence Divergence, or MACD, tracks the gap between a faster and a slower exponential moving average (EMA) of a stock’s price. As that gap changes, MACD can help describe price momentum. It does not measure the cost of executing a trade or predict the next price.

A standard MACD display has three parts: the MACD line, a signal line that smooths it, and a histogram showing the distance between those lines. Values are in price units, such as US$ per share, rather than percentages. A MACD of +US$2 therefore has a different relative size for a US$20 stock than for a US$200 stock.

## How it is calculated

The common settings use 12, 26 and 9 *trading-day* periods for a daily chart:

- `EMA_t(N) = α × P_t + (1 − α) × EMA_(t−1)(N); α = 2 / (N + 1)`
- `MACD_t = EMA_t(12) − EMA_t(26)`
- `Signal_t = EMA_t(MACD, 9)`
- `Histogram_t = MACD_t − Signal_t`

Here, `P_t` is the closing price on day `t`, in US$ per share; `N` is the EMA period; and `α` is its weighting factor. `EMA_t(N)` is the price EMA on day `t`. `EMA_t(MACD, 9)` applies the same EMA calculation to the MACD line’s values, not to closing prices. The MACD line, signal line and histogram are all in US$ per share. A charting service must initialize each EMA from earlier observations, so a calculation cannot be reconstructed from one day’s price alone.

When the MACD line crosses above the signal line, the histogram moves above zero. A crossover below moves it below zero. Separately, MACD crosses zero when the 12-period and 26-period price EMAs become equal and then change order. These are descriptions of historical price calculations, not instructions to trade.

## Worked example

Suppose a hypothetical stock has enough earlier daily observations to initialize all three EMAs. At the end of a trading day:

1. Its 12-period price EMA is US$102 per share, and its 26-period price EMA is US$100 per share.
2. The MACD line is `US$102 − US$100 = +US$2` per share.
3. Suppose the already-initialized 9-period EMA of the MACD line is +US$1.50 per share. That is the signal line.
4. The histogram is `US$2 − US$1.50 = +US$0.50` per share.

This snapshot shows the faster price EMA above the slower one and MACD above its signal line. It does not establish that a crossover occurred that day: identifying one requires the previous day’s values. Nor does a positive histogram establish what will happen next.

## Why it matters before you trade

MACD can provide context for a price trend when reviewing a proposed stock trade. A pre-trade check asks additional questions that MACD does not answer: How large is the proposed order relative to daily volume? What are the estimated spread and market impact? What volatility and portfolio concentration would the trade introduce? A price-based indicator and an execution assessment address different risks.

MACD is calculated from past prices, and EMA smoothing introduces lag. Signals may reverse quickly when prices fluctuate without a sustained trend. Settings and chart intervals also matter: daily MACD and hourly MACD use different observations, even if both display 12, 26 and 9.

## How PreTrAIde uses it

PreTrAIde’s product facts do not state that it calculates or uses MACD. Its pre-trade analysis is not chart-pattern technical analysis. Instead, a user specifies a stock basket with sides, quantities and execution conditions before placing an order. PreTrAIde assesses factors including estimated spread, participation in daily volume, market impact and daily volatility, then provides decision-support verdicts and reasoning. Those assessments can complement a separate review of MACD, but a PreTrAIde verdict is not a MACD signal or an investment recommendation.

## Common mistakes

- Treating a signal-line crossover as a reliable price forecast. It records a change in calculated momentum, not a guaranteed outcome.
- Confusing a zero-line crossover with a signal-line crossover. They compare different quantities.
- Comparing raw MACD values across stocks at very different prices as though the values were percentages.
- Assuming the histogram’s positive value means momentum is increasing. It may remain positive while shrinking.
- Ignoring spread, order size and liquidity because the chart looks favorable. MACD does not estimate execution costs.

---
Source: https://pretraide.com/glossary/macd
