跳到主要內容

獲取輪證篩選列表

該接口用於獲取輪證行情列表數據,支持按不同字段排序和篩選輪證。

SDK Links

Python
longport.openapi.QuoteContext.warrant_list
Rust
longport::quote::QuoteContext#warrant_list
Go
QuoteContext.WarrantList
Node.js
QuoteContext#warrantList
信息

Request

Parameters

NameTypeRequiredDescription
symbolstring標的代碼,使用 ticker.region 格式,例如:700.HK
filter_configobject篩選條件
∟ sort_byint32根據哪一項數據進行排序,例如:0,序號見響應數據 OrderSequence 字段。
∟ sort_orderint32升降順序,例如:1

可选值:
0 - 升序
1 - 降序
∟ sort_offsetint32分頁的第一條數據偏移量,例如 0
∟ sort_countint32分頁的每一頁數量,例如 20, 填 0 時不分頁
∟ typeint32[]篩選輪證類型 例如:[0,1]

可选值:
0 - 認購
1 - 認沽
2 - 牛證
3 - 熊證
4 - 界內證
∟ issuerint32[]篩選發行商,例如:[12,14]發行商 ID 通過接口獲取
∟ expiry_dateint32[]篩選輪證過期時間,例如:[1]

可選值:
1 - 低於 3 個月
2 - 3 - 6 個月
3 - 6 - 12 個月
4 - 大於 12 個月
∟ price_typeint32[]篩選價內價外,例如:[2]

可选值:
1 - 價內
2 - 價外
∟ statusint32[]篩選狀態,例如:[2]

可选值:
2 - 終止交易
3 - 等待上市
4 - 正常
languageint32響應的語言,例如:[1]

可选值:
0 - 簡體
1 - English
2 - 繁体

Protobuf

message WarrantFilterListRequest {
string symbol = 1;
FilterConfig filter_config = 2;
int32 language = 3;
}

message FilterConfig {
int32 sort_by = 1;
int32 sort_order = 2;
int32 sort_offset = 3;
int32 sort_count = 4;
repeated int32 type = 5;
repeated int32 issuer = 6;
repeated int32 expiry_date = 7;
repeated int32 price_type = 8;
repeated int32 status = 9;
}

Request Example

from longport.openapi import QuoteContext, Config, WarrantSortBy, SortOrderType

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

resp = ctx.warrant_list("700.HK", WarrantSortBy.LastDone, SortOrderType.Ascending)
print(resp)

Response

Response Properties

NameTypeDescriptionOrderSequenceSupport_Call/PutSupport_Bull/BearSupport_Inline
warrant_listobject[]渦輪篩選數據列表
∟ symbolstring標的代碼truetruetrue
∟ namestring標的名稱truetruetrue
∟ last_donestring最新價0truetruetrue
∟ change_ratestring漲跌幅1truetruetrue
∟ change_valstring漲跌額2truetruetrue
∟ volumeint64成交量3truetruetrue
∟ turnoverstring成交額4truetruetrue
∟ expiry_datestring到期日,使用 YYMMDD 格式5truetruetrue
∟ strike_pricestring行權價6truetruefalse
∟ upper_strike_pricestring上限價7falsefalsetrue
∟ lower_strike_pricestring下限價8falsefalsetrue
∟ outstanding_qtystring街貨量9truetruetrue
∟ outstanding_ratiostring街貨比10truetruetrue
∟ premiumstring溢價率11truetruetrue
∟ itm_otmstring價內/價外12truetruefalse
∟ implied_volatilitystring引伸波幅13truefalsefalse
∟ deltastring對沖值14truefalsefalse
∟ call_pricestring收回價15falsetruefalse
∟ to_call_pricestring距收回價16falsetruefalse
∟ effective_leveragestring有效槓桿17truefalsefalse
∟ leverage_ratiostring槓桿比率18truetruetrue
∟ conversion_ratiostring換股比率19truetruefalse
∟ balance_pointstring打和點20truetruefalse
∟ statusint32狀態,

可選值:
2 - 終止交易
3 - 等待上市
4 - 正常
21truetruetrue
total_countint32符合條件的輪證總數量

Protobuf

message WarrantFilterListResponse {
repeated FilterWarrant warrant_list = 1;
int32 total_count = 2;
}

message FilterWarrant {
string symbol = 1;
string name = 2;
string last_done = 3;
string change_rate = 4;
string change_val = 5;
int64 volume = 6;
string turnover = 7;
string expiry_date = 8;
string strike_price = 9;
string upper_strike_price = 10;
string lower_strike_price = 11;
string outstanding_qty = 12;
string outstanding_ratio = 13;
string premium = 14;
string itm_otm = 15;
string implied_volatility = 16;
string delta = 17;
string call_price = 18;
string to_call_price = 19;
string effective_leverage = 20;
string leverage_ratio = 21;
string conversion_ratio = 22;
string balance_point = 23;
int32 status = 24;
}

Response JSON Example

{
"warrant_list": [
{
"symbol": "13157.HK",
"name": "騰訊麥銀二七沽 A",
"last_done": "2.26",
"change_rate": "-0.0216450216450218",
"change_val": "-0.050000000000000266",
"turnover": "0",
"expiry_date": "20220705",
"strike_price": "442.233",
"upper_strike_price": "0",
"lower_strike_price": "0",
"outstanding_qty": "5000",
"outstanding_ratio": "0.0003",
"premium": "0.016784269662921222",
"itm_otm": "0.23524476916014864",
"implied_volatility": "0.5275",
"delta": "-0.8524",
"call_price": "0",
"effective_leverage": "-2.627683451852457",
"leverage_ratio": "3.0826882353970637",
"conversion_ratio": "48.544",
"balance_point": "332.52356000000003",
"status": 4
},
{
"symbol": "13649.HK",
"name": "騰訊摩通二五沽 A",
"last_done": "1.14",
"change_rate": "0",
"change_val": "0",
"turnover": "0",
"expiry_date": "20220518",
"strike_price": "445.223",
"upper_strike_price": "0",
"lower_strike_price": "0",
"outstanding_qty": "80000",
"outstanding_ratio": "0.0004",
"premium": "0.010810703725606",
"itm_otm": "0.24038066317328624",
"implied_volatility": "0.5997",
"delta": "-0.7964",
"call_price": "0",
"effective_leverage": "-2.4335424241487873",
"leverage_ratio": "3.055678583813144",
"conversion_ratio": "97.087",
"balance_point": "334.54382000000004",
"status": 4
}
],
"total_count": 1197
}

錯誤碼

協議錯誤碼業務錯誤碼描述排查建議
3301600無效的請求請求參數有誤或解包失敗
3301606限流降低請求頻次
7301602服務端內部錯誤請重試或聯繫技術人員處理
7301600請求標的不存在檢查請求的 symbol 是否正確
7301603標的無行情標的沒有請求的行情數據
7301604無權限沒有獲取標的行情的權限
7301607接口限制減少每頁數據數量