WarrantCbbc
Warrant filter
QuoteClient.get_warrant_filter(self, symbol, page=None, page_size=None, sort_field_name=None, sort_dir=None. filter_params=None)
Description
Get the data of nest round CBBC quotes list, support sorting and filtering rounds by different fields.
Parameters
Parameters | Type | Required | Description --- symbol|str|Yes|positive symbol|str|Yes|Underlying stock code page|int|No|Page number, start from 0, default is 0 page_size|int|No|the number of pages per page, default 50 sort_field_name|str|No|sorting field, default expireDate (refer to the field that returns the object WarrantItem) sort_dir|tigeropen.common.consts.SortDirection|No|sort order, enumerate ASC/DESC , default ASC filter_params|tigeropen.quote.request.model.WarrantFilterParams|No|filtering parameters
The fields of the filter_params are as follows.
Parameter | Type | Required | Description |
---|---|---|---|
issuer_name | str | No | Issuer (refer to the issuerName field of the returned FilterBounds instance), default all |
expire_ym | str | No | expiration date, in yyyy-MM format |
state | int | No | state, 0 all, 1 normal, 2 terminated, 3 waiting for listing, default 0 |
warrant_type | set[int] | No | type WarrantType (1:Call, 2: Put, 3: Bull, 4: Bear, 0: All), default All |
in_out_price | set[int] | No | 1: In-price (contains flat values), -1: Out-of-price |
lot_size | set[int] | No | the number of shares per lot |
entitlement_ratio | set[float] | No | exchange ratio |
strike | tuple[float, float] | No | strike interval |
effective_leverage | tuple[float, float] | No | effective_leverage_interval |
leverage_ratio | tuple[float, float] | No | leverage ratio interval |
call_price | tuple[float, float] | No | recovery price interval |
volume | tuple[int, int] | No | volume interval |
premium | tuple[float, float] | No | premium interval |
outstanding_ratio | tuple[float, float] | No | street_ratio interval |
implied_volatility | tuple[float, float] | No | implicit_volatility interval |
Single-valued fields can be set with set_xxx()
, set-type fields can be added with add_xxx()
, and tuple-type fields can be set with set_xxx_range()
. Refer to the following example
Returntigeropen.quote.domain.filter.WarrantFilterItem
The structure is as follows:
class WarrantFilterItem.
def __init__(self, items=None, page=None, total_page=None, total_count=None, bounds=None).
self.items = items
self.page = page
self.total_page = total_page
self.total_count = total_count
self.bounds = bounds
Name | Type | Description |
---|---|---|
page | int | page |
totalPage | int | total pages |
totalCount | int | total number of data |
bounds | tigeropen.quote.domain.filter.WarrantFilterBounds | Filter conditions that can be set by the request, see below for description |
items | pandas.DataFrame | fields see description below |
WarrantFilterBounds
object structure:
Name | Type | Description |
---|---|---|
issuer_name | list[str] | Issuer_name |
expire_date | list[str] | expiration date |
lot_size | list[int] | number of shares per lot |
entitlement_ratio | list<double> | exchange ratio |
leverage_ratio | dict | leverage ratio range |
strike | dict | strike price range |
premium | dict | premium range |
outstanding_ratio | dict | street_ratio range |
implied_volatility | dict | implied_volatility_range |
effective_leverage | dict | effective_leverage_range |
call_price | dict | recovery_price range |
items
DataFrame Field Descriptions:
Name | type | description |
---|---|---|
symbol | str | the underlying stock symbol |
name | str | subject name |
type | warrant_type | type, 1: call, 2: put, 3: bull, 4: bear |
sec_type | str | contract type, nest: war/bull/bear: iopt |
market | str | market, hk |
entitlement_ratio | float | exchange ratio |
entitlement_price | float | exchange price |
premium | float | premium |
breakeven_point | float | expiry break-even point |
call_price | float | recovery price (CBBCs only) |
before_call_level | float | call price (percentage, e.g. 0_196875, meaning _19_6875%) |
expire_date | str | expiration date |
last_trading_date | str | last trade date |
state | warrant_state | state, 1_normal, 2_terminated, 3_waiting for listing |
change_rate | float | increase/decrease |
change | float | rates |
latest_price | float | latest_price |
volume | long | volume |
outstanding_ratio | float | street ratio |
lot_size | int | share per lot |
strike | float | strike price |
in_out_price | float | in_price (greater than _0)/out_price (less than _0) |
delta | float | hedge value |
leverage_ratio | float | leverage ratio |
effective_leverage | float | effective leverage |
implied_volatility | float | implicit volatility |
Example
from tigeropen.quote.quote_client import QuoteClient
from tigeropen.tiger_open_config import get_client_config
from tigeropen.quote.request.model import WarrantFilterParams
client_config = get_client_config(private_key_path='', tiger_id='your tiger id', account='your account')
quote_client = QuoteClient(client_config)
filter_params = WarrantFilterParams()
filter_params.set_expire_ym('2024-06')
# 0 All, 1 Normal, 2 Terminate Trades, 3 Waiting to be listed
filter_params.set_state(1)
filter_params.add_lot_size(1000)
filter_params.add_lot_size(5000)
# -1:out the money, 1: in the money
filter_params.add_in_out_price(1)
filter_params.add_in_out_price(-1)
# 1:Call, 2: Put, 3: Bull,4: Bear, 0: All
filter_params.add_warrant_type(2)
filter_params.add_warrant_type(4)
filter_params.set_premium_range(0, 1)
filter_params.set_strike_range(100, 500)
filter_params.set_implied_volatility_range(1, 100)
result = quote_client.get_warrant_filter('00700', page_size=10,
sort_field_name='implied_volatility',
sort_dir=SortDirection.DESC,
filter_params=filter_params)
print(result)
Response Example
WarrantFilterItem({
'items':
symbol name type sec_type market entitlement_ratio entitlement_price premium breakeven_point expire_date last_trading_date state change_rate change latest_price volume amount outstanding_ratio lot_size strike in_out_price delta leverage_ratio effective_leverage implied_volatility
0 27062 Tecent A.P Put WAR HK 47.483 1.377007 0.605231 148.669993 2023-10-20 2023-10-16 Normal 0.035714 0.001 0.029 0 0.0 0.002 5000 150.047 1.50988 -0.030389 273.491711 -8.311172 69.847,
'page': 0, 'total_page': 1, 'total_count': 1,
'bounds': FilterBounds({
'issuer_name': ['Goldman Sachs'],
'expire_date': ['2026-01', '2025-12', '2025-09', '2025-08', '2024-12', '2024-07', '2024-06', '2024-04', '2024-03', '2024-02', '2024-01', '2023-12', '2023-11', '2023-10', '2023-09', '2023-08', '2023-07', '2023-06', '2023-05', '2023-04'],
'lot_size': [1000, 5000, 10000, 50000],
'entitlement_ratio': [1.053, 47.483, 50.0, 92.166, 94.967, 100.0, 460.829, 474.834, 485.437, 500.0],
'leverage_ratio': {'min': 1.391437, 'max': 3056.79342},
'strike': {'min': 111.301, 'max': 717.11},
'premium': {'min': -0.314923, 'max': 0.908085},
'outstanding_ratio': {'min': 0.0, 'max': 1.0},
'implied_volatility': {'min': 0.0, 'max': 131.085},
'effective_leverage': {'min': -46.321801, 'max': 20.189945},
'call_price': {'min': 113.96, 'max': 520.0}})})
Get Warrant Quotes
QuoteClient.get_warrant_briefs(symbols)
Description
Get warrant bull/bear real-time quotes
Parameters
Parameter | Type | Required | Description --- symbols|list[str] | | symbols symbols|
list[str]`|yes|The code of the warrant symbol, the maximum is 50
return pandas.DataFrame
The structure is as follows:
field | type | description |
---|---|---|
symbol | str | the code of the subject |
name | str | the name of the underlying |
exchange | str | exchange |
market | str | market |
sec_type | str | contract type |
currency | str | currency |
expiry | str | expiration_date_yyyy_mm_dd |
strike | str | strike price |
right | str | direction (put/call) |
multiplier | float | quantity per lot |
last_trading_date | int | last_trading_date timestamp |
entitlement_ratio | float | exchange ratio |
entitlement_price | float | exchange price |
min_tick | float | minimum unit of change in share price |
listing_date | int | timestamp of the listing date |
call_price | float | recovery price* (CBBCs only)* |
halted | halted_status | Whether halted or not. 0: Normal_3: Suspended_4: Delisted |
underlying_symbol | str | underlying_asset_code |
timestamp | int | timestamp |
latest_price | float | the latest price |
pre_close | float | closing price of the previous trading day |
open | float | opening price |
high | float | high |
low | float | lowest price |
volume | int | volume |
amount | float | volume |
premium | float | premium |
outstanding_ratio | float | street_ratio |
implied_volatility | float | implied_volatility |
in_out_price | float | in_price/out_of_price |
delta | float | hedge_value (warrant only) |
leverage_ratio | float | Leverage |
breakeven_point | float | breakeven point at maturity |
Example
from tigeropen.quote.quote_client import QuoteClient
from tigeropen.tiger_open_config import get_client_config
client_config = get_client_config(private_key_path='', tiger_id='your tiger id', account='your account')
quote_client = QuoteClient(client_config)
briefs = quote_client.get_warrant_briefs(['15792', '58603'])
print(briefs)
Response example
symbol name exchange market sec_type currency expiry strike right multiplier last_trading_date entitlement_ratio entitlement_price min_tick listing_date call_price halted underlying_symbol timestamp latest_price pre_close open high low volume amount premium outstanding_ratio in_out_price leverage_ratio breakeven_point implied_volatility delta
0 58603 Vontobel HANG SENG INDEX R.P SEHK HK IOPT HKD 2025-03-28 16700.0 PUT 10000.0 1743004800000 10000.0 1890.00 0.001 1668009600000 16600.0 Normal HSI 1681200546054 0.189 0.175 0.188 0.189 0.170 444000 83378.0 0.277040 0.0375 0.226661 10.838751 14810.00 NaN NaN
1 15792 China Merchants Bank JP ErjiaguA.P SEHK HK WAR HKD 2022-10-31 39.39 PUT 5000.0 1666627200000 10.0 2.28 0.001 1651075200000 NaN Normal 03968 1681200546030 0.228 0.223 0.227 0.228 0.216 21572000 4795879.0 0.058122 0.0011 0.000254 17.280702 37.11 130.577 -0.9844