Skip to main content

Get Filtered Warrant

This API is used to obtain the quotes of HK warrants, and supports sorting and filtering.

Request

Parameters

NameTypeRequiredDescription
symbolstringYesSecurity code, in ticker.region format, for example:700.HK
filter_configobjectYesFilter conditions
∟ sort_byint32YesWhich data to sort by, for example: 0, see the OrderSequence field of the response data for the sequence number.
∟ sort_orderint32YesOrder, for example: 1

Optional value:
0 - Ascending
1 - Descending
∟ sort_offsetint32YesThe first data offset of paging, for example: 0
∟ sort_countint32YesNumber of paginated pages per page, for example: 20, no pagination when filling in 0
∟ typeint32[]NoFilter warrant type, for example: [0,1]

Optional value:
0 - Call
1 - Put
2 - Bull
3 - Bear
4 - Inline
∟ issuerint32[]NoFilter issuer example: [12,14], obtain Issuer ID through API
∟ expiry_dateint32[]NoFilter expiry date, example: [1]

Optional value:
1 - Less than 3 months
2 - 3 - 6 months
3 - 6 - 12 months
4 - greater than 12 months
∟ price_typeint32[]NoFilter in/out of bounds, for example: [2]

Optional value:
1 - In bounds
2 - Out bounds
∟ statusint32[]NoFilter status, for example: [2]

Optional value:
2- Suspend trading
3 - Papare List
4 - Normal
languageint32YesLanguage, for example: [1]

Optional value:
0 - zh-CN
1 - en
2 - zh-HK

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[]Filted warrant data list
∟ symbolstringSecurity codetruetruetrue
∟ namestringSecurity nametruetruetrue
∟ last_donestringLatest price0truetruetrue
∟ change_ratestringQuote change rate1truetruetrue
∟ change_valstringQuote change2truetruetrue
∟ volumeint64Volume3truetruetrue
∟ turnoverstringTurnover4truetruetrue
∟ expiry_datestringExpiry date, in YYMMDD format5truetruetrue
∟ strike_pricestringStrike price6truetruefalse
∟ upper_strike_pricestringUpper bound price7falsefalsetrue
∟ lower_strike_pricestringLower bound price8falsefalsetrue
∟ outstanding_qtystringOutstanding quantity9truetruetrue
∟ outstanding_ratiostringOutstanding ratio10truetruetrue
∟ premiumstringPremium11truetruetrue
∟ itm_otmstringIn/out of the bound12truetruefalse
∟ implied_volatilitystringImplied volatility13truefalsefalse
∟ deltastringGreek value Delta14truefalsefalse
∟ call_pricestringCall price15falsetruefalse
∟ to_call_pricestringPrice interval from the call price16falsetruefalse
∟ effective_leveragestringEffective leverage17truefalsefalse
∟ leverage_ratiostringLeverage ratio18truetruetrue
∟ conversion_ratiostringConversion ratio19truetruefalse
∟ balance_pointstringBreakeven point20truetruefalse
∟ statusint32Status,

Optional value:
2- Suspend trading
3 - Papare List
4 - Normal
21truetruetrue
total_countint32Total number of eligible

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": "MBTENCT@EP2207A",
"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": "MBTENCT@EP2205A",
"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
}

Error Code

Protocol Error CodeBusiness Error CodeDescriptionTroubleshooting Suggestions
3301600Invalid requestInvalid request parameters or unpacking request failed
3301606Request rate limitReduce the frequency of requests
7301602Server errorPlease try again or contact a technician to resolve the issue
7301600Symbol not foundCheck that the requested symbol is correct
7301603No quotesSecurity no quote
7301604No accessNo access to security quote
7301607Too many symbols in one pageReduce the number of symbols in a page of request