API Reference: Technical Indicators
Details
Docs navigation
- Getting started: Quickstart, Authentication, Rate limits, Errors and retries
- Guides: Symbol formats, Timestamps and time zones, Pagination, Split and dividend adjustments, WebSocket streaming, Dataset downloads, Excel and Google Sheets, Changelog
- API reference: Stock bars, Stock trades and quotes, Snapshots and movers, Tickers, exchanges, calendar, Splits and dividends, Fundamentals and SEC filings, Options chain and Greeks, Options EOD, bars, OI, Forex, Crypto, Crypto derivatives, Futures bars and continuous, Settlements and COT, Indices, Economic data, Technical indicators (you are here)
- SDKs: Python, JavaScript
The technical indicators endpoint computes RSI, MACD, moving averages, Bollinger Bands and similar values on our servers from the same bars the bars endpoints return, so you get one number per bar without writing the maths yourself. It works for any symbol we carry: stocks, ETFs, futures, FX and crypto. This page lists the indicators, their parameters, the output shape and how the values line up with bars.
Early access. Planned v1 endpoint, not live yet. Included on every plan. History is limited to the bar history your plan has for that symbol, and every call counts as one request against your normal rate limit.
Details
Get an indicator
GET https://api.marketdata.co/v1/indicators/{indicator}
Indicators
indicator |
Name | Output |
|---|---|---|
sma |
Simple moving average | value |
ema |
Exponential moving average | value |
rsi |
Relative strength index (Wilder) | value, 0 to 100 |
macd |
Moving average convergence divergence | values.macd, values.signal, values.histogram |
bbands |
Bollinger Bands | values.upper_band, values.middle_band, values.lower_band |
atr |
Average true range | value |
stoch |
Stochastic oscillator | values.k, values.d |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
symbol |
string | yes | Any of our symbols, e.g. AAPL, ESZ6, ES.C1, BTC-USD, EURUSD |
|
interval |
string | no | 1d |
Bar interval, as on the bars endpoints |
time_period |
integer | no | 14 | Look-back length in bars |
series_type |
string | no | close |
close, open, high, low |
fast_period, slow_period, signal_period |
integer | no | 12, 26, 9 | macd only |
nbdev |
number | no | 2 | bbands only: band width in standard deviations |
start, end |
string | no | 1 year | Range of output values |
adjusted |
boolean | no | true |
Stocks: compute on split-adjusted bars |
limit, cursor, format |
no | Paging and output |
Response fields
| Field | Type | Description |
|---|---|---|
symbol |
string | Symbol |
indicator |
string | e.g. rsi |
interval |
string | Bar interval used |
time_period |
number | Look-back length |
series_type |
string | Price used |
timestamp / date |
string | The bar the value belongs to |
value |
number | Single-output indicators |
values |
object | Multi-output indicators |
signal |
string | buy, sell or neutral from a simple rule, where defined (optional) |
Example
Example (curl), 14-day RSI for Apple:
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.marketdata.co/v1/indicators/rsi?symbol=AAPL&interval=1d&time_period=14&series_type=close&start=2026-01-01"
Example response, illustrative value:
{
"status": "ok",
"count": 1,
"next_cursor": null,
"results": [
{
"symbol": "AAPL",
"indicator": "rsi",
"interval": "1d",
"time_period": 14,
"series_type": "close",
"date": "2026-11-18",
"value": 61.84
}
]
}
Example (Python), MACD on hourly Bitcoin bars:
import os
import requests
import pandas as pd
r = requests.get(
"https://api.marketdata.co/v1/indicators/macd",
headers={"Authorization": f"Bearer {os.environ['MARKETDATA_API_KEY']}"},
params={"symbol": "BTC-USDT", "interval": "1h", "start": "2026-10-01"},
)
rows = r.json()["results"]
macd = pd.json_normalize(rows).set_index("timestamp")
print(macd[["values.macd", "values.signal", "values.histogram"]].tail())
Details
Check it against your own maths
The values should match a standard implementation on the same bars. A quick RSI check in pandas:
def rsi(close: pd.Series, n: int = 14) -> pd.Series:
delta = close.diff()
gain = delta.clip(lower=0).ewm(alpha=1 / n, adjust=False).mean()
loss = (-delta.clip(upper=0)).ewm(alpha=1 / n, adjust=False).mean()
return 100 - 100 / (1 + gain / loss)
Small differences in the first few dozen values come from the warm-up period. See the gotchas below.
API
Errors for this endpoint
| HTTP | error.code |
When |
|---|---|---|
| 400 | invalid_parameter |
Unknown indicator, time_period below 2, or fast_period not smaller than slow_period |
| 403 | plan_required |
Interval or history your plan does not include for that symbol |
| 404 | symbol_not_found |
Unknown symbol |
Watch out
Notes and gotchas
- Exponential indicators (EMA, RSI, MACD, ATR) depend on where the calculation starts. We warm up on extra bars before your
start, so values match a long-running chart rather than a calculation that begins atstart. - The value on a bar uses that bar's close. In a backtest, act on it at the next bar, not the same one.
- Intraday indicators on stocks include extended-hours bars only if those bars exist in the interval you pick. Regular-session-only indicators need the bars endpoint and your own maths.
- Turning
adjustedoff on stocks makes moving averages jump at splits. signalis a simple rule (for example RSI above 70 issell). It is there for convenience, not as advice.- For many indicators on many symbols, pulling bars once and computing locally uses far fewer requests.
Keep reading
Next steps
- Stock bars reference
- Learn: RSI strategy backtest
- Product: technical indicators API
Details
Was this page useful?
[Yes] [No]
Need an indicator we don't calculate? Tell us on the custom data form.