跳到主要內容

獲取標的的期權鏈到期日期權標的列表

該接口用於獲取標的的期權鏈到期日期權標的列表。

信息

Request

Parameters

NameTypeRequiredDescription
symbolstring標的代碼,使用 ticker.region 格式,例如:700.HK
expiry_datestring期權到期日,使用 YYMMDD 格式,例如:20220429,通過 期權到期日 接口獲取

Protobuf

message OptionChainDateStrikeInfoRequest {
string symbol = 1;
string expiry_date = 2;
}

Response

Response Properties

NameTypeDescription
strike_price_infoobject[]到期日期權標的列表
∟ pricestring行權價
∟ call_symbolstringCALL 期權標的代碼
∟ put_symbolstringPUT 期權標的代碼
∟ standardbool是否標準期權

Protobuf

message OptionChainDateStrikeInfoResponse {
repeated StrikePriceInfo strike_price_info = 1;
}

message StrikePriceInfo {
string price = 1;
string call_symbol = 2;
string put_symbol = 3;
bool standard = 4;
}

Request Example

# 獲取標的的期權鏈到期日期權標的列表
# https://open.longportapp.com/docs/quote/pull/optionchain-date-strike
# 運行前請訪問“開發者中心“確保賬戶有正確的行情權限。
# 如沒有開通行情權限,可以通過“LongPort”手機客戶端,並進入“我的 - 我的行情 - 行情商城”購買開通行情權限。
from datetime import date
from longport.openapi import QuoteContext, Config

config = Config.from_env()
ctx = QuoteContext(config)

resp = ctx.option_chain_info_by_date("AAPL.US", date(2023, 1, 20))
print(resp)

Response JSON Example

{
"strike_price_info": [
{
"price": "100",
"call_symbol": "AAPL220429C100000.US",
"put_symbol": "AAPL220429P100000.US",
"standard": true
},
{
"price": "105",
"call_symbol": "AAPL220429C105000.US",
"put_symbol": "AAPL220429P105000.US",
"standard": true
},
{
"price": "110",
"call_symbol": "AAPL220429C110000.US",
"put_symbol": "AAPL220429P110000.US",
"standard": true
},
{
"price": "115",
"call_symbol": "AAPL220429C115000.US",
"put_symbol": "AAPL220429P115000.US",
"standard": true
}
]
}

錯誤碼

協議錯誤碼業務錯誤碼描述排查建議
3301600無效的請求請求參數有誤或解包失敗
3301606限流降低請求頻次
7301602服務端內部錯誤請重試或聯繫技術人員處理
7301600請求數據非法檢查請求的 symbolexpiry_date 數據格式