Most indicators answer one question. The MACD indicator tries to answer two at once: which way is the trend pointing, and is the push behind it getting stronger or weaker?
It does this with nothing more than two moving averages and the gap between them. That simple idea has made MACD one of the most used indicators on every charting platform, from stocks and futures to forex and crypto.
In this guide you will learn who created MACD, the full MACD formula with a worked example, how to read the MACD line, signal line and MACD histogram, which MACD settings traders use, three rule-based strategies, and where MACD lets you down.
MACD Indicator Quick Facts
| Feature | Detail |
|---|---|
| Full name | Moving Average Convergence Divergence |
| Created by | Gerald Appel (late 1970s); histogram added by Thomas Aspray (1986) |
| Indicator type | Momentum and trend (separate panel, oscillates around zero) |
| Default settings | Fast EMA 12 · Slow EMA 26 · Signal EMA 9 · Source: close |
| Parts | MACD line, signal line, histogram |
| Best markets | Any liquid market that trends: stocks, indices, forex, crypto |
| Best timeframes | 1-hour to weekly; noisy on very low timeframes |
Origin and History
MACD was created by Gerald Appel, an American analyst and money manager, in the late 1970s. His idea was to measure the distance between a fast and a slow moving average. When the two averages move apart, momentum is building; when they move together, it is fading. That is where the name comes from: the averages converge and diverge.
Appel’s original version had two lines: the MACD line and a smoothed signal line. In 1986, Thomas Aspray added the MACD histogram, which plots the gap between those two lines as bars. His aim was to spot a coming crossover earlier, while the gap was still shrinking.
Today, most charting platforms show all three parts by default.
The MACD Formula
MACD has three parts, all built from exponential moving averages (EMAs). An EMA is an average that gives more weight to recent prices.
1. MACD line = EMA(12) − EMA(26)
2. Signal line = EMA(9) of the MACD line
3. Histogram = MACD line − Signal line
How an EMA updates each bar:
EMA today = EMA yesterday + α × (Price today − EMA yesterday)
where α (alpha) = 2 ÷ (n + 1), and n is the EMA length.
| EMA length | α |
|---|---|
| 12 | 2 ÷ 13 = 0.1538 |
| 26 | 2 ÷ 27 = 0.0741 |
| 9 | 2 ÷ 10 = 0.2000 |
Worked example: one bar
Yesterday’s values: EMA(12) = 101.20, EMA(26) = 100.40, signal line = 0.65. Today’s close = 102.00.
Step 1: Update the fast EMA
EMA(12) = 101.20 + 0.1538 × (102.00 − 101.20) = 101.20 + 0.1231 = 101.32
Step 2: Update the slow EMA
EMA(26) = 100.40 + 0.0741 × (102.00 − 100.40) = 100.40 + 0.1185 = 100.52
Step 3: MACD line
101.32 − 100.52 = 0.80
Step 4: Update the signal line
Signal = 0.65 + 0.20 × (0.80 − 0.65) = 0.65 + 0.03 = 0.68
Step 5: Histogram
0.80 − 0.68 = +0.12
What this tells you: the fast EMA is above the slow EMA (MACD above zero, so the bias is up), and MACD is above its signal line (positive histogram, so upward momentum is growing).
Platform differences
On TradingView, the MACD settings let you switch both the main averages (“Oscillator MA type”) and the signal line (“Signal MA type”) between EMA and SMA. The classic MACD uses EMA for both. If two charts show different MACD values for the same market, check these two settings first.

How to Read the MACD Indicator
1. Position versus the zero line
– MACD above zero: the 12 EMA is above the 26 EMA, an upward bias.
– MACD below zero: the 12 EMA is below the 26 EMA, a downward bias.
2. MACD crossover (signal-line cross)
– MACD crosses above its signal line: a bullish crossover; upward momentum is increasing.
– MACD crosses below its signal line: a bearish crossover.
3. The MACD histogram
– Bars growing away from zero: momentum in that direction is strengthening.
– Bars shrinking toward zero: momentum is fading, and a crossover may be coming.
4. Divergence
When price makes a new high but MACD makes a lower high (or the opposite at lows), momentum is not confirming price. See our guide to RSI divergence for how to draw and confirm divergences; the same rules apply to MACD.
One important point: MACD is measured in price units, not 0–100 like RSI. A MACD of 2 on a $50 stock means something very different from a MACD of 2 on Bitcoin. So MACD has no fixed overbought or oversold levels, and you cannot compare its values across markets.


MACD Settings
| Setting | Default | Lower it | Raise it |
|---|---|---|---|
| Fast length | 12 | MACD reacts faster, more crossovers | Slower, fewer crossovers |
| Slow length | 26 | Closer to the fast EMA, more sensitive | Smoother MACD line |
| Signal length | 9 | Earlier crossovers, more false ones | Later, fewer crossovers |
| Source | Close | — | HL2 or HLC3 give a slightly smoother input |
| Oscillator / Signal MA type | EMA / EMA | SMA makes it slower and steadier | — |
Starting points by trading style (to test, not proven best values):
| Trading style | Timeframe | Settings to test | Notes |
|---|---|---|---|
| Scalping | 1–5 min | 12, 26, 9 or faster (e.g. 8, 17, 9) | Many false crossovers; use a higher-timeframe trend filter |
| Intraday | 15 min – 1H | 12, 26, 9 | Ignore crossovers right after the open |
| Swing | 4H – Daily | 12, 26, 9 | The classic use |
| Positional | Daily – Weekly | 12, 26, 9 or slower (e.g. 19, 39, 9) | Few signals, longer trends |
A common mistake is changing settings after every losing trade. Pick one setting per timeframe, test it on past charts, and keep it unless you have a clear reason to change it.
Want to see the difference on a real chart? Our guide to the best MACD settings compares 12-26-9, 8-17-9 and 5-35-5 on the same chart, with starting points for scalping, day and swing trading.
MACD Strategies
These are educational examples, not recommendations. Test any rule on your own market and timeframe, and decide your risk per trade before you enter.
Strategy 1: Crossover with a zero-line filter
- Long setup: MACD is above zero (uptrend bias).
- Entry: MACD crosses above its signal line after a pullback.
- Stop-loss: below the recent swing low, or 1.5 × ATR below entry.
- Exit: when MACD crosses back below its signal line, or at a 2:1 reward-to-risk target.
- Shorts: the mirror image, with MACD below zero.
- Works best: in steady trends.
- Fails when: price moves sideways around the zero line, where crossovers flip back and forth.
Strategy 2: Histogram turn in a pullback
- Trend filter: price above its 200-period EMA.
- Setup: price pulls back, and the histogram dips below zero.
- Entry: when the histogram prints its first bar higher than the one before (a “turn up”), while price holds above the pullback low.
- Stop-loss: below the pullback low.
- Exit: when the histogram turns down from above zero, or at the previous swing high.
- Why it helps: the histogram turns before the actual crossover, so entries are earlier. The trade-off is more false starts.
Strategy 3: MACD divergence with price confirmation
- Setup: price makes a lower low while MACD (or the histogram) makes a higher low: a bullish divergence. (Bearish: higher high in price, lower high in MACD.)
- Entry: only after price closes above the swing high between the two lows.
- Stop-loss: below the second low.
- Exit: at the next major resistance, or when a divergence forms against you.
- Works best: after long, stretched moves.
- Fails when: the trend is very strong; divergence can repeat several times.
Confluence: What to Combine With MACD
| Pair with | Why it helps |
|---|---|
| RSI | RSI is bounded (0–100) and shows how stretched price is; MACD shows trend bias and momentum shifts. They answer different questions. (See our MACD vs RSI comparison.) |
| 200 EMA | A higher-level trend filter for MACD crossovers. |
| ATR | Sets stop distance and position size. |
| Support and resistance | Crossovers at a key level carry more weight than crossovers in empty space. |
| VWAP | For intraday trading: favour bullish crossovers above VWAP. |
Redundant pairings to avoid: MACD plus the PPO (Percentage Price Oscillator) plus a separate 12/26 EMA crossover. The PPO is MACD expressed as a percentage, and an EMA crossover is the same event as MACD crossing zero. Three tools, one signal.
Limitations and Common Mistakes
- Lag. MACD is built from moving averages of moving averages, so it confirms moves late. Crossovers often come after a good part of the move.
- Whipsaws in ranges. In sideways markets, MACD hovers around zero and crosses its signal line again and again.
- No overbought or oversold levels. MACD is unbounded. A “high” MACD is not a sell signal on its own.
- Values can’t be compared across markets. MACD is in price units, so a reading on one chart means nothing on another.
- Signals can change on the live bar. A crossover can appear and disappear before the bar closes. Judge it on closed bars.
- Treating the histogram peak as a top. A shrinking histogram means momentum is slowing, not that price will reverse.
Frequently Asked Questions
What is the MACD indicator?
The MACD indicator (Moving Average Convergence Divergence) shows the difference between a 12-period and a 26-period exponential moving average, plus a 9-period signal line and a histogram. Traders use it to judge trend direction and changes in momentum.
What are the best MACD settings for day trading?
Most day traders start with the default 12, 26, 9 on 15-minute to 1-hour charts. Some test faster settings on lower timeframes, but they produce more false signals. There is no single best setting; test on your own market. For a side-by-side comparison, see our best MACD settings guide.
What does the MACD histogram show?
The MACD histogram shows the gap between the MACD line and its signal line. Growing bars mean momentum is strengthening; shrinking bars mean it is fading and a crossover may be coming.
What does a MACD crossover mean?
A bullish MACD crossover is when the MACD line crosses above its signal line, suggesting upward momentum is increasing. A bearish crossover is the opposite. Crossovers are more reliable in the direction of the larger trend.
Is MACD a leading or lagging indicator?
MACD is mainly a lagging indicator because it is built from moving averages. The histogram and divergences can give earlier warnings, but they still need price confirmation.
Keep Learning
MACD and RSI are often used together. Learn the other half in our RSI indicator guide, and see how to trade momentum warnings in RSI divergence. For stops and position size, read our ATR indicator guide. Compare MACD with RSI and Stochastic in our Momentum Indicators guide. Want to see MACD in a popular rule-based strategy? Read our MACD 200 EMA Strategy Check.
Want practical indicator guides in your inbox? Join the IndicatorHQ newsletter. Subscribers will also get our free Indicator Settings Cheat Sheet when it launches.
How we checked this guide
- Method: Formula and worked example verified in code
- Chart: Real TradingView data, Amazon (AMZN) and gold 4-hour, at least 30 days old
- Repainting: Does not repaint on closed bars
Risk disclaimer: This article is for educational purposes only and is not investment advice. The strategies shown are examples, not recommendations, and past chart behaviour does not guarantee future results. Trading in stocks, derivatives, forex and crypto involves a substantial risk of loss and is not suitable for everyone. Consider speaking to a SEBI-registered investment adviser (or a licensed adviser in your country) before making trading decisions. See our full Disclaimer.