Skip to content

Futures Correlation ​

GET /api/v1.0/quote/{symbol}/future/correlation

Correlation time series between a future and up to 4 related futures. related_codes is required, comma-separated. cycle is the lookback window; range is the returned span. Coefficients unscaled to [-1, 1].

Request ​

ParameterTypeInRequiredDescription
symbolstringpathyesFutures symbol (path param), e.g. US.CLmain
related_codesstringqueryyesRelated futures, comma-separated, max 4, e.g. US.GCmain,US.ESmain
cyclestringquerynoLookback window: THREE_MONTH (default), SIX_MONTH, ONE_YEAR, THREE_YEAR
rangestringquerynoReturned span: ONE_DAY, THREE_MONTH, SIX_MONTH, ONE_YEAR (default), THREE_YEAR
page_sizeintquerynoPoints per related future, default 30, max 200
page_flagstringquerynoPage cursor. Omit on the first page; pass back pagination.page_flag

Example ​

bash
curl -X GET 'https://webapi.moomoo.com/api/v1.0/quote/US.AAPL/future/correlation?related_codes=1&cycle=1&range=1' \
  -H 'Authorization: Bearer <AccessToken>' | jq

Response ​

FieldTypeDescription
data.itemsobject[]
data.totalintegerTotal points in range (longest series)
data.items[].codeintegerPrimary futures symbol
data.items[].related_codeintegerRelated futures symbol
data.items[].pointsobjectCorrelation time series
data.items[].points[].timestampintegerTimestamp, unix seconds (UTC+8 aligned)
data.items[].points[].correlationstringCorrelation coefficient
pagination.completedstringTrue when the requested range is fully covered
pagination.page_flagstringNext offset. Empty when completed is true

Errors ​

ret_codeerror.codeDescription
0—Success
-3invalid_parameterMissing or invalid parameter
-7invalid_symbolUnknown symbol
-8unsupportedMarket or product is not supported
-9permission_deniedMissing permission
-10no_dataNo data
-11rate_limitedToo many requests

Sample ​

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "total": "example",
    "items": [
      {
        "code": 0,
        "related_code": 0,
        "points": "example"
      }
    ]
  },
  "pagination": {
    "completed": true,
    "page_flag": ""
  }
}