Trend · TickAtlas Learn

Moving Average Convergence Divergence (MACD)

MACD is a trend-following momentum indicator that shows the relationship between two EMAs. It consists of the MACD line, signal line, and histogram, making it one of the most versatile indicators available.

10 min readUpdated 2026-09-24Trend
MACD · quick spec
GET /v1/indicator ?symbol=EURUSD&indicator=MACD_main&timeframe=H1
Family
Trend
Series
main · signal · histogram
Best timeframes
H1 · H4 · D1
Last updated
2026-09-24

TL;DR

  • MACD is a trend indicator used in technical analysis
  • MACD crossing above signal line is bullish; crossing below is bearish. Histogram shows momentum strength. Zero-line crossovers indicate trend direction changes.
  • Best timeframes: H1, H4, D1
  • Skip to API docs
Understand

What is Moving Average Convergence Divergence?

MACD is a trend-following momentum indicator that shows the relationship between two EMAs. It consists of the MACD line, signal line, and histogram, making it one of the most versatile indicators available.

Calculate

How MACD is calculated

formula
MACD Line = EMA(12) - EMA(26)
Signal Line = SMA(9) of MACD Line
Histogram = MACD Line - Signal Line
Interpret

How to interpret MACD

MACD crossing above signal line is bullish; crossing below is bearish. Histogram shows momentum strength. Zero-line crossovers indicate trend direction changes.

Apply

Trading strategies using MACD

Strategy 1: MACD Crossover

The classic MACD strategy trades when the MACD line crosses the signal line.

Entry rules

Buy when MACD crosses above signal line. Sell when MACD crosses below signal line.

Exit rules

Exit on reverse crossover or when histogram starts declining after reaching extreme.

Strategy 2: MACD Divergence

Divergence between MACD and price signals potential reversals.

Entry rules

Enter long on bullish divergence (price lower low, MACD higher low). Enter short on bearish divergence.

Exit rules

Target previous swing level. Use ATR for stop loss placement.

Combine

Combining MACD with other indicators

MACD works best when combined with complementary indicators:

  • MACD + RSI: Combine for stronger confluence signals
  • MACD + EMA: Combine for stronger confluence signals
  • MACD + ADX: Combine for stronger confluence signals
Timeframes

MACD across different timeframes

MACD works across all 7 timeframes but performs best on H1, H4, D1 for most trading styles.

H1H4D1

Learn about all 7 timeframes

Query

Accessing MACD via the TickAtlas API

GET https://tickatlas.com/v1/indicator

Python example

python
import requests

url = "https://tickatlas.com/v1/indicator"
headers = {"X-API-Key": "YOUR_API_KEY"}
params = {
  "symbol": "EURUSD",
  "indicator": "MACD_main",
  "timeframe": "H1"
}

response = requests.get(url, headers=headers, params=params)
data = response.json()
print(data)

Example response — illustrative values

200 OK
{
  "success": true,
  "data": {
    "symbol": "EURUSD",
    "indicator": "MACD_main",
    "timeframe": "H1",
    "value": -0.000798,
    "updated_at": 1790272367,
    "server_time": "2026-09-24T17:52:47+00:00",
    "bid": 1.13663,
    "ask": 1.13675
  }
}
Avoid

Common mistakes to avoid

  • Trading MACD signals without considering the overall trend
  • Ignoring MACD histogram divergence which often precedes the crossover
  • Using MACD in very choppy/sideways markets where it generates many false signals
FAQ

Frequently asked questions

What are the best MACD settings?

The standard settings (12, 26, 9) work well for most markets. Some traders use (8, 17, 9) for faster signals or (5, 35, 5) for smoother signals on lower timeframes.

How to read the MACD histogram?

Rising histogram bars (becoming more positive) indicate increasing bullish momentum. Falling bars indicate weakening momentum. The histogram crossing zero corresponds to the MACD/signal line crossover.

Technical

Calculation details

Parameters. MACD Line = EMA(12) − EMA(26) of the bar close. Signal Line = a 9-period simple moving average of the MACD Line. Histogram = MACD Line − Signal Line. These are fixed and not configurable per request. Platforms that compute the signal line as an exponential average will generally show different signal and histogram values from this API, even on identical prices.

Timestamps. updated_at is UTC.

Price series. Indicators are computed on our data, not an exchange's consolidated tape, and session coverage varies by symbol. For US equities, the half-hour price history we serve includes rows outside each symbol's trading hours that repeat the previous bar's prices exactly; these are not used in the calculation.

Continue learning

From learning to building

Put MACD to work in your application.

Sign up with $2.50 of starting credit and query pre-calculated MACD data across 7 timeframes, from M1 to D1.