组合期权价差
GET/api/v1.0/quote/{symbol}/option-strategy-spread查询指定标的、策略、到期日下后端给出的价差列表及默认价差。返回 spread_list(已还原为真实价格)和 default_spread。
拿到价差后再用组合期权策略的 spread 参数查询组合列表。1/2/6/15/100 通常不下发价差(spread_list 为空);4/7/8/9/11/13/14/16 会给出列表,这些策略查组合时必须带 spread。
请求参数
| 参数 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
symbol | string | 路径 | 是 | 期权标的代码,仅美股。例 US.AAPL。 |
strategy | int | 查询 | 是 | 组合策略类型。详见命名词典。 |
expire_time | string | 查询 | 是 | 近月到期日 yyyy-MM-dd,例 2026-08-21。 |
far_expire_time | string | 查询 | 条件必填 | 远月到期日 yyyy-MM-dd。CalendarSpread(15) / DiagonalSpread(16) 必填,且必须晚于 expire_time。 |
index_option_type | int | 查询 | 否 | 美股指数期权类型,仅美股指数标的需传。取值用命名词典 US 段(1000+)。详见命名词典。 |
filter_standard | string | 查询 | 否 | 按标准/非标准过滤,默认 ALL。详见命名词典。 |
请求示例
bash
curl 'https://webapi.moomoo.com/api/v1.0/quote/US.AAPL/option-strategy-spread?strategy=4&expire_time=2026-08-21' | jq
curl 'https://webapi.moomoo.com/api/v1.0/quote/US.AAPL/option-strategy-spread?strategy=15&expire_time=2026-08-21&far_expire_time=2026-09-18' | jq响应字段
返回 data 对象:
| 字段 | 类型 | 说明 |
|---|---|---|
spread_list | number[] | 价差列表(已还原为真实价格)。无价差时为空数组。 |
default_spread | number | 默认价差(已还原为真实价格)。spread_list 为空时本字段可能不下发。 |
限制范围
- 仅支持美股(含美股指数期权);港股 / 日股返回
ret_code=-8 unsupported。 - 指数标的必须传
index_option_type(US 段);普通正股不传该参数。 expire_time必须是该标的真实到期日(可用期权到期日查询)。strategy取值与是否须far_expire_time见命名词典。
错误码
| ret_code | error.code | 触发条件 | 处理建议 |
|---|---|---|---|
| 0 | — | 成功(含空 spread_list) | — |
| -3 | invalid_parameter | symbol / strategy / expire_time 缺失或不合法;日期格式不是 yyyy-MM-dd;CalendarSpread / DiagonalSpread 未传 far_expire_time,或远月不晚于近月 | 校正请求参数后重试 |
| -7 | invalid_symbol | 路径 symbol 在证券库查不到 | 通过搜索接口确认代码合法性 |
| -8 | unsupported | symbol 市场不是 US | 该市场不支持组合期权,无需重试 |
| -5 | internal_error | 网关内部错误 / 后端调用失败 / 超时 | 稍后重试或联系平台 |
响应示例
json
{
"ret_code": 0,
"ret_msg": "",
"data": {
"spread_list": [2.5, 5, 7.5, 10],
"default_spread": 5
}
}