MACD Calculator

MACD line, signal line and histogram for every bar from your prices, with crossovers and a chart (12, 26, 9 or your own).

Runs in your browser. Files never leave your device.
One closing price per line, or a CSV export with a Close column. Oldest first; exports listed newest first are put in date order.
Showing example EUR/USD-style daily data.

150 bars · 2026-01-05 to 2026-07-31

12, 26 and 9 are the standard settings.

MACD(12, 26, 9) on the last bar-0.004548Signal -0.002132 · histogram -0.002416. MACD is below its signal line, and below zero.
MACD and signal line

Last 117 bars

  • MACD
  • Signal
Last 20 bars, newest first
DateCloseMACDSignalHistogram
2026-07-311.1670-0.004548-0.002132-0.002416
2026-07-301.1718-0.003839-0.001528-0.002311
2026-07-291.1713-0.003367-0.000950-0.002417
2026-07-281.1734-0.002665-0.000346-0.002319
2026-07-271.1799-0.0019430.000234-0.002177
2026-07-241.1828-0.0016560.000778-0.002434
2026-07-231.1787-0.0015610.001387-0.002948
2026-07-221.1797-0.0009990.002124-0.003123
2026-07-211.1763-0.0003700.002905-0.003274
2026-07-201.17960.0007860.003723-0.002938
2026-07-171.18450.0019130.004458-0.002545
2026-07-161.18470.0028240.005094-0.002269
2026-07-151.19110.0039270.005661-0.001734
2026-07-141.19430.0046250.006095-0.001470
2026-07-131.19660.0051230.006462-0.001339
2026-07-101.19680.0054500.006797-0.001346
2026-07-091.19690.0057680.007133-0.001365
2026-07-081.19340.0060800.007475-0.001394
2026-07-071.19910.0067460.007823-0.001077
2026-07-061.19480.0069170.008092-0.001175

Indicators describe past prices; they don't predict what happens next. A calculator for planning trades, not financial advice. Check your broker's contract size, pip definition and fees.

About the MACD Calculator

Calculate MACD (Moving Average Convergence Divergence) from your own prices: the MACD line, the signal line and the histogram for every bar. Paste closing prices or load a CSV export, keep the standard 12, 26 and 9 settings or change them, and see the latest values with a chart.

The page tells you whether MACD is above or below its signal line and above or below zero on the last bar, and whether the two lines crossed on that bar.

How it works

The MACD line is the 12-bar exponential moving average of the close minus the 26-bar one. When the shorter average is above the longer, MACD is positive, which happens when prices have been rising.

The signal line is a 9-bar exponential moving average of the MACD line itself, started from the simple average of the first nine MACD values. The histogram is MACD minus the signal line, so it is positive when MACD is above its signal.

Because the 26-bar average needs 26 closes and the signal needs nine MACD values, the first complete reading appears on the 34th bar. On a price rising by the same amount every bar, MACD settles at 7 times that amount: the gap between the two averages' lags.

Assumptions and limits

  • Prices must be in date order, oldest first; dated files listed newest first are reordered automatically.
  • Exponential averages are seeded with simple averages, the method most charting platforms use.
  • MACD is in price units, so its size depends on the market's price; compare it with its own history, not between markets.
  • MetaTrader's built-in MACD draws the signal line as a simple rather than exponential average, so its signal values differ from this page and from TradingView.

Worked examples

A steady rise

On closes rising by 1 every bar, MACD(12, 26, 9) settles at exactly 7 and the histogram at 0.

Flat prices

When the price doesn't change, both averages equal it and MACD, signal and histogram are all 0.

A crossover

If the histogram was negative on the previous bar and is positive now, MACD has just crossed above its signal line.

How to use the MACD Calculator

  1. Add your prices. At least 34 closes for the standard settings.
  2. Set the periods. 12, 26 and 9 unless you use others.
  3. Read MACD. The line, signal and histogram for every bar.

Frequently asked questions

How is MACD calculated?

Take the 12-period EMA of the closing price and subtract the 26-period EMA to get the MACD line. The signal line is a 9-period EMA of the MACD line, and the histogram is the MACD line minus the signal line.

What does a MACD crossover mean?

When MACD crosses above its signal line, short-term momentum has turned up relative to the recent past; crossing below means it has turned down. Crossovers happen often in sideways markets, so many traders also check the trend.

What does MACD above zero mean?

It means the 12-period average is above the 26-period average, so prices have been rising over that window. Below zero means the shorter average is under the longer one, a sign of a recent fall.

How many prices do I need for MACD?

With the standard 12, 26, 9 settings the first full reading, with a signal line, appears on the 34th bar. For values that match a trading platform closely, give it a few hundred bars.

Can I change the MACD settings?

Yes. Some traders use faster settings such as 5, 35, 5 or 8, 17, 9. The fast period must be shorter than the slow one, and each must be a whole number of bars.

This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.