MACD API — Signal Line Crossovers Delivered as JSON
Get MACD main line, signal line, and histogram in real time — three values, one endpoint each. No candle math. No TA libraries. Just the numbers your strategy needs.
No credit card. $2.50 PAYG credit on sign up.
What is the MACD API?
MACD (Moving Average Convergence Divergence) tracks the relationship between two EMAs to identify trend direction and momentum shifts. The histogram quantifies the gap between the main line and signal line — when MACD crosses above the signal line, it signals potential bullish momentum. TickAtlas pre-calculates all three values (MACD_main, MACD_signal, MACD_hist) from live broker data so your bot gets the answer, not raw candles to process.
One Request. Instant Data.
curl -X GET \
"https://tickatlas.com/v1/indicator?symbol=EURUSD&indicator=MACD_main&timeframe=H1" \
-H "X-API-Key: YOUR_API_KEY" import requests
API_KEY = "YOUR_API_KEY"
BASE = "https://tickatlas.com/v1/indicator"
HEADERS = {"X-API-Key": API_KEY}
def get_macd(symbol, timeframe="H1"):
lines = {}
for indicator in ["MACD_main", "MACD_signal", "MACD_hist"]:
r = requests.get(BASE, headers=HEADERS, params={
"symbol": symbol,
"indicator": indicator,
"timeframe": timeframe
})
data = r.json()
lines[indicator] = data["value"]
return lines
macd = get_macd("EURUSD")
print(f"MACD main: {macd['MACD_main']:.5f}")
print(f"MACD signal: {macd['MACD_signal']:.5f}")
print(f"MACD hist: {macd['MACD_hist']:.5f}")
# Crossover detection
if macd['MACD_main'] > macd['MACD_signal']:
print("Bullish crossover — MACD above signal line")
else:
print("Bearish crossover — MACD below signal line") Why Use TickAtlas?
Pre-Calculated, Sub-100ms
Indicator values are computed server-side on every new candle. Your app queries the result — no TA library, no candle history needed.
7 Timeframes
M1, M5, M15, M30, H1, H4, D1 — the same endpoint serves scalpers and position traders alike.
Forex, Crypto, Commodities
EURUSD, GBPUSD, XAUUSD, BTCUSD, USDJPY — data available for all symbols active on connected broker terminals.
Plug into any stack
- ChatGPT Custom GPTs
- Claude Tools
- Python / pandas
- Node.js
- Discord bots
- Slack webhooks
- n8n
- Zapier
- Google Sheets
Three Values. One Endpoint Each.
Available MACD indicators
- MACD_main — MACD line (EMA12 − EMA26)
- MACD_signal — 9-period EMA of MACD main
- MACD_hist — Histogram (main − signal)
Frequently Asked Questions
What MACD parameters does the API use?
The standard 12/26/9 configuration: fast EMA of 12 periods, slow EMA of 26 periods, and a 9-period signal line EMA. This matches the default across most trading platforms.
Do I need to query all three MACD values separately?
Yes — MACD_main, MACD_signal, and MACD_hist are each available as separate indicator names on the same endpoint. A crossover detection strategy typically queries all three once per candle close.
Can I get MACD divergence signals automatically?
The API returns raw values — divergence detection logic runs in your code. You query MACD_main and MACD_hist over time using the /v1/indicator/history endpoint and apply your own divergence algorithm.
Which timeframes are best for MACD trading?
MACD is most reliable on H1, H4, and D1 for swing and position trading. M5/M15 can be used for intraday setups but generate more noise. All 7 timeframes (M1, M5, M15, M30, H1, H4, D1) are supported.
Start Building in 5 Minutes
Sign up, grab your API key, make your first request.
Every new account gets $2.50 in free PAYG credits. No card required.