Futures Correlation
GET/api/v1.0/quote/{symbol}/future/correlationCorrelation 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
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
symbol | string | path | yes | Futures symbol (path param), e.g. US.CLmain |
related_codes | string | query | yes | Related futures, comma-separated, max 4, e.g. US.GCmain,US.ESmain |
cycle | string | query | no | Lookback window: THREE_MONTH (default), SIX_MONTH, ONE_YEAR, THREE_YEAR |
range | string | query | no | Returned span: ONE_DAY, THREE_MONTH, SIX_MONTH, ONE_YEAR (default), THREE_YEAR |
page_size | int | query | no | Points per related future, default 30, max 200 |
page_flag | string | query | no | Page cursor. Omit on the first page; pass back pagination.page_flag |
Example
bash
curl -X GET 'https://webapi.futunn.com/api/v1.0/quote/US.AAPL/future/correlation?related_codes=1&cycle=1&range=1' \
-H 'Authorization: Bearer <AccessToken>' | jqResponse
| Field | Type | Description |
|---|---|---|
data.items | object[] | |
data.total | integer | Total points in range (longest series) |
data.items[].code | integer | Primary futures symbol |
data.items[].related_code | integer | Related futures symbol |
data.items[].points | object | Correlation time series |
data.items[].points[].timestamp | integer | Timestamp, unix seconds (UTC+8 aligned) |
data.items[].points[].correlation | string | Correlation coefficient |
pagination.completed | string | True when the requested range is fully covered |
pagination.page_flag | string | Next offset. Empty when completed is true |
Errors
| ret_code | error.code | Description |
|---|---|---|
| 0 | — | Success |
| -3 | invalid_parameter | Missing or invalid parameter |
| -7 | invalid_symbol | Unknown symbol |
| -8 | unsupported | Market or product is not supported |
| -9 | permission_denied | Missing permission |
| -10 | no_data | No data |
| -11 | rate_limited | Too 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": ""
}
}