An EMA never fully forgets an old price, it just gives it less and less weight as newer bars arrive. That is the difference from a simple moving average, which drops a price entirely once it falls out of the window. Massive's ema endpoint does the arithmetic server-side from a ticker, a timespan and a window.
Applies to
- Plans: every plan, including the free Basic tier.
- Endpoints: /v1/indicators/ema/{ticker}, with timespan and window.
- Asset classes: stocks, options, indices, forex and crypto, using that asset class's ticker format.
How to call it
curl -X GET "https://api.massive.com/v1/indicators/ema/AAPL?timespan=day&window=14&series_type=close×tamp.lte=2026-09-30&limit=1&apiKey=YOUR_API_KEY"
Response
{
"results": {
"values": [
{ "timestamp": 1790740800000, "value": 333.2590593313312 }
]
},
"status": "OK"
}
The timestamp is in milliseconds: 1790740800000 is 30 September 2026 at 00:00 Eastern, the daily bar for that session.
timespan is the bar size the indicator is computed on, and window is how many of those bars it looks back over. A 14 on a day timespan and a 14 on a minute timespan are entirely different indicators.
How to read it
Compared with a simple average of the same window it turns sooner when the price changes direction, at the cost of reacting to moves that turn out to be noise. Which of those you want is the whole reason both exist.
Choosing a window
A shorter window reacts sooner and produces more signals, most of which are noise; a longer one is steadier and later. There is no correct value, and the common choices are conventions rather than findings. Pick the window from the horizon you actually trade or analyze on, and use the same one consistently rather than tuning it until the history looks good, which is the quickest route to a result that does not repeat.
Why does Massive's EMA differ from my chart?
Massive's EMA can differ slightly from another tool's value for the same bar, for four reasons: how the average is started, how much history is loaded, which hours the bars cover, and split adjustment.
How the average is started. The EMA endpoint uses the multiplier 2 / (window + 1) and starts from the first close of the bars it loads, not from a simple average of the first window closes. Recomputing that way from the daily aggregates reproduces the API value exactly. Over the 51 AAPL daily bars from 21 July to 30 September 2026, a first-close start gives 333.2671 and a simple-average start gives 333.2829.
How much history is loaded. The server loads bars before your range on its own, and the number it loads grows with limit and window, so the value for one date moves in the last decimal places as you ask for more points. AAPL's 14-day EMA for 30 September 2026 depends on the request like this:
| Request parameters | Daily bars loaded | Value |
|---|---|---|
| timestamp=2026-09-30 | 51, from 21 July 2026 | 333.26710 |
| timestamp.lte=2026-09-30&limit=1 | 66 | 333.25906 |
| timestamp.lte=2026-09-30&limit=10 | 75 | 333.25987 |
| timestamp.lte=2026-09-30&limit=1000 | 1,065 | 333.25995 |
| timestamp.lte=2026-09-30&limit=5000 | 5,065 | 333.25995 |
Each response's results.underlying.url shows the aggregates request behind the value, so you can see how far back it reached. Ask for timestamp.lte with a large limit when you need the value that no longer changes, and compare it with a chart that also loads long history.
Which hours the bars cover. Minute and hour EMAs on stocks are computed on bars that include pre-market and after-hours trading, because the stock aggregates do: one-minute AAPL bars run from 4:00 AM to 7:59 PM Eastern by bar start time. AAPL's 15-period EMA on one-minute bars at 9:35 AM Eastern on 30 September 2026 is 331.4992, and 65 of the 71 bars behind it were pre-market. The same EMA over regular-session bars only is 331.0345, a gap of about 0.46, roughly thirty times the 0.016 between the two starting values over 51 daily bars. A chart set to regular hours will not match; to reproduce it, compute the EMA yourself from the regular-session aggregate bars.
Split adjustment. The bars behind the EMA are split-adjusted by default. Pass adjusted=false to match a chart that shows unadjusted prices.
If you see an error
A response with no values in results means the endpoint could not compute a point for the time you asked for, not that your date range was too short. The values key is missing rather than empty, so read it with a default. The EMA endpoint loads the history before your range on its own, so even a two-day range with a 200-day window returns values:
curl -X GET "https://api.massive.com/v1/indicators/ema/AAPL?timespan=day&window=200&series_type=close×tamp.gte=2026-09-29×tamp.lte=2026-09-30&apiKey=YOUR_API_KEY"
Response
{
"results": {
"values": [
{ "timestamp": 1790740800000, "value": 293.79180505370454 },
{ "timestamp": 1790654400000, "value": 293.3975518381639 }
]
},
"status": "OK"
}
Common causes of a missing values key are a timestamp that matches no bar (a weekend, a market holiday, or a millisecond value that is not the start of a bar), a lowercase ticker, because tickers are case-sensitive, and a ticker whose whole history has fewer bars than window, such as a recent listing. For "the latest value as of" a moment, use timestamp.lte rather than timestamp, which matches only the bar that starts exactly then.
A jump on a single date is usually a stock split rather than the market. Bars are split-adjusted by default, so mixing adjusted and unadjusted history will show up here.
{"status":"NOT_AUTHORIZED"} is about the asset class rather than the indicator: it follows the same subscription as the bars underneath.

