組合期權價差
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
}
}