跳到主要內容

獲取輪證實時行情

該接口用於獲取港股輪證標的的實時行情,包括輪證的特有數據。

SDK Links

Python
longport.openapi.QuoteContext.warrant_quote
Rust
longport::quote::QuoteContext#warrant_quote
Go
QuoteContext.WarrantQuote
Node.js
QuoteContext#warrantQuote
信息

Request

Parameters

NameTypeRequiredDescription
symbolstring[]標的代碼列表,使用 ticker.region 格式,例如:[13447.HK]

校驗規則:
每次請求支持傳入的標的數量上限是 500

Protobuf

message MultiSecurityRequest {
repeated string symbol = 1;
}

Request Example

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

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

resp = ctx.warrant_quote(["21125.HK"])
print(resp)

Response

Response Properties

NameTypeDescription
secu_quoteobject[]期權標的行情數據列表
∟ symbolstring標的代碼
∟ last_donestring最新價
∟ prev_closestring昨收價
∟ openstring開盤價
∟ highstring最高價
∟ lowstring最低價
∟ timestampint64最新成交的時間戳
∟ volumeint64成交量
∟ turnoverstring成交額
∟ trade_statusint32標的交易狀態,詳見TradeStatus
∟ warrant_extendobject輪證擴展行情
∟∟ implied_volatilitystring引申波幅
∟∟ expiry_datestring到期日,使用:YYMMDD 格式
∟∟ last_trade_datestring最後交易日,使用:YYMMDD 格式
∟∟ outstanding_ratiostring街貨比
∟∟ outstanding_qtyint64街貨量
∟∟ conversion_ratiostring換股比率
∟∟ categorystring輪證類型

可選值:
Call - 認購證
Put - 認沽證
Bull - 牛證
Bear - 熊證
Inline - 界內證
∟∟ strike_pricestring行權價
∟∟ upper_strike_pricestring上限價
∟∟ lower_strike_pricestring下限價
∟∟ call_pricestring收回價
∟∟ underlying_symbolstring對應的正股標的代碼

Protobuf

message WarrantQuoteResponse {
repeated WarrantQuote secu_quote = 2;
}

message WarrantQuote {
string symbol = 1;
string last_done = 2;
string prev_close = 3;
string open = 4;
string high = 5;
string low = 6;
int64 timestamp = 7;
int64 volume = 8;
string turnover = 9;
TradeStatus trade_status = 10;
WarrantExtend warrant_extend = 11;
}

message WarrantExtend {
string implied_volatility = 1;
string expiry_date = 2;
string last_trade_date = 3;
string outstanding_ratio = 4;
int64 outstanding_qty = 5;
string conversion_ratio = 6;
string category = 7;
string strike_price = 8;
string upper_strike_price = 9;
string lower_strike_price = 10;
string call_price = 11;
string underlying_symbol = 12;
}

Response JSON Example

{
"secu_quote": [
{
"symbol": "66642.HK",
"last_done": "0.345",
"prev_close": "0.365",
"open": "0.345",
"high": "0.345",
"low": "0.345",
"timestamp": 1651130421,
"volume": 200000,
"turnover": "69000.000",
"warrant_extend": {
"implied_volatility": "0.319",
"expiry_date": "20220830",
"last_trade_date": "20220829",
"outstanding_ratio": "0.0001",
"outstanding_qty": 20000,
"conversion_ratio": "10000",
"category": "Bear",
"strike_price": "23200.000",
"upper_strike_price": "0.000",
"lower_strike_price": "0.000",
"call_price": "23100.000",
"underlying_symbol": "HSI.HK"
}
},
{
"symbol": "14993.HK",
"last_done": "0.073",
"prev_close": "0.066",
"open": "0.069",
"high": "0.076",
"low": "0.069",
"timestamp": 1651130930,
"volume": 320825000,
"turnover": "23401125.000",
"warrant_extend": {
"implied_volatility": "0.404",
"expiry_date": "20220927",
"last_trade_date": "20220921",
"outstanding_ratio": "0.0247",
"outstanding_qty": 2465000,
"conversion_ratio": "10",
"category": "Call",
"strike_price": "70.050",
"upper_strike_price": "0.000",
"lower_strike_price": "0.000",
"call_price": "0.000",
"underlying_symbol": "2318.HK"
}
}
]
}

接口限制

警告
  • 港股 BMP 行情,超過 20 支的港股標的將響應延遲行情。

錯誤碼

協議錯誤碼業務錯誤碼描述排查建議
3301600無效的請求請求參數有誤或解包失敗
3301606限流降低請求頻次
7301602服務端內部錯誤請重試或聯繫技術人員處理
7301607接口限制請求的標的數量超限,請減少單次請求標的數量