Futures · Statistics
Futures correlations
/v1/futures/correlationsfuturesCorrelationsThe correlation of log returns between each pair of up to three products (front months) over the latest window return observations, and the beta of the first product of each pair against the second (covariance over the second's variance). Complete bars are aligned on the bar times every product with data has, so each return spans one common bar step. A product with no bars is named in coverage.missing and every pair that includes it is null with 0 observations. Reads 5-minute bars of five sessions or daily bars of 21 prior sessions (so at most 20 daily returns are available), one bar read per product, through a deferred history read, so a first request can answer 503 data_pending; retry. coverage.observations is the number of returns used. The figures use a longer lookback than the dated rows your plan's history window allows (the window limits the rows returned, not the lookback a statistic is computed from); this route returns no dated rows.
Example request
curl -sS --get "https://api.ordermap.si/v1/futures/correlations" \
-H "Authorization: Bearer $ORDERMAP_API_KEY" \
--data-urlencode symbols=ES,NQconst params = new URLSearchParams({
symbols: "ES,NQ",
});
const res = await fetch(`https://api.ordermap.si/v1/futures/correlations?${params}`, {
headers: { Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}` },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { data, meta } = await res.json();
console.log(data, meta.coverage);Set ORDERMAP_API_KEY to your key. Replace the dates with a recent trading date.
Parameters
3 parameters, 1 required.
| Parameter | Type and limits | Description |
|---|---|---|
symbolsqueryrequired | array<string>comma-separated in one parameter1 to 3 itemseach at most 128 characterspattern ^[A-Za-z0-9]{1,3}$ | Two or three different futures product roots, for example ES,NQ. |
intervalqueryoptional | string5m1ddefault 5m | Bar size of the returns. |
windowqueryoptional | integerdefault 78min 20max 500 | Return observations to use, from the latest bar back. With interval=1d at most 20 are available (one daily read holds 22 sessions and only completed bars count, so the session still forming is left out, and a holiday takes one more); a larger window is cut to what is held, and coverage.observations says how many returns were used. |
Response
| Status | Meaning | Body |
|---|---|---|
200 | Successful response. | Schema below |
400 | Invalid, unknown or repeated parameters, or an invalid cursor. | Error object |
401 | Missing or invalid API key. | Error object |
403 | The plan, dataset release or account state does not allow this request. | Error object |
422 | The request is valid but no data exists for it. | Error object |
429 | Rate limit, burst limit or cooldown; wait Retry-After seconds.Retry-After | Error object |
500 | Internal error. | Error object |
503 | Data temporarily unavailable; retry after Retry-After seconds.Retry-After | Error object |
504 | The request timed out. | Error object |
Authenticated responses carry the X-RateLimit-* headers (see rate limits); 429 and 503 add Retry-After.
200 response body
dataobjectrequiredCorrelations between products.8 fields insideintervalstringrequiredBar size used.5m1dmatrixmap<map<number>>requiredCorrelation of every product against every other, keyed by root then by root; 1 on the diagonal; null where it could not be computed.pairsarray<object>requiredEach pair once.5 fields insideastringrequiredFirst product.bstringrequiredSecond product.betanumber | nullrequiredBeta of a against b.correlationnumber | nullrequiredPearson correlation of the log returns, from -1 to 1.observationsintegerrequiredReturns the pair used.
metaobjectrequiredMeta object
Example response
{
"data": {
"interval": "5m",
"matrix": {
"ES": {
"ES": 1,
"NQ": 0.93
},
"NQ": {
"ES": 0.93,
"NQ": 1
}
},
"pairs": [
{
"a": "ES",
"b": "NQ",
"beta": 0.71,
"correlation": 0.93,
"observations": 78
}
]
},
"meta": {
"as_of": 1760659200123,
"coverage": {
"complete": true
},
"delay_ms": 0,
"delayed": false,
"request_id": "0199f0c2-5a1e-7c3b-9d4e-2b6f8a1c3d5e",
"source": "cme"
}
}Values are illustrative. Missing values are null, never 0.
