Skip to content

Futures · Statistics

Futures correlations

Rolling return correlation and beta between two or three futures products, aligned on common bars.
GET/v1/futures/correlationsfuturesCorrelations
On this page

The 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,NQ

Set ORDERMAP_API_KEY to your key. Replace the dates with a recent trading date.

Parameters

3 parameters, 1 required.

ParameterType and limitsDescription
symbolsqueryrequiredarray<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.
intervalqueryoptionalstring5m1ddefault 5mBar size of the returns.
windowqueryoptionalintegerdefault 78min 20max 500Return 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

StatusMeaningBody
200Successful response.Schema below
400Invalid, unknown or repeated parameters, or an invalid cursor.Error object
401Missing or invalid API key.Error object
403The plan, dataset release or account state does not allow this request.Error object
422The request is valid but no data exists for it.Error object
429Rate limit, burst limit or cooldown; wait Retry-After seconds.Retry-AfterError object
500Internal error.Error object
503Data temporarily unavailable; retry after Retry-After seconds.Retry-AfterError object
504The 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 inside
    • intervalstringrequiredBar size used.5m1d
    • matrixmap<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 inside
      • astringrequiredFirst 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.