中文

Warrants and Callable Bull/Bear Certificates

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 warrant and callable bull/bear certificate quote list data, supports sorting and filtering warrants by different fields.

Parameters

ParameterTypeRequiredDescription
symbolstrYesUnderlying stock symbol
pageintNoPage number, starting from 0, default is 0
page_sizeintNoItems per page, default 50
sort_field_namestrNoSort field, default expireDate (refer to WarrantItem fields)
sort_dirtigeropen.common.consts.SortDirectionNoSort direction, enum ASC/DESC, default ASC
filter_paramstigeropen.quote.request.model.WarrantFilterParamsNoFilter parameters

The filter_params fields are as follows:

ParameterTypeRequiredDescription
issuer_namestrNoIssuer (refer to FilterBounds issuerName field), default all
expire_ymstrNoExpiry date, format yyyy-MM
stateintNoStatus: 0=All, 1=Normal, 2=Terminated, 3=Pending listing (default: 0)
warrant_typeset[int]NoType WarrantType: 1=Call, 2=Put, 3=Bull, 4=Bear, 0=All (default: all)
in_out_priceset[int]No1=In-the-money (including at-the-money), -1=Out-of-the-money
lot_sizeset[int]NoLot size
entitlement_ratioset[float]NoEntitlement ratio
striketuple[float, float]NoStrike price range
effective_leveragetuple[float, float]NoEffective leverage range
leverage_ratiotuple[float, float]NoLeverage ratio range
call_pricetuple[float, float]NoCall price range
volumetuple[int, int]NoVolume range
premiumtuple[float, float]NoPremium range
outstanding_ratiotuple[float, float]NoOutstanding ratio range
implied_volatilitytuple[float, float]NoImplied volatility range

Single-value fields can be set using set_xxx() methods, set-type fields can be added using add_xxx() methods, and tuple-type fields can be set using set_xxx_range() methods. See example below.

Returns

tigeropen.quote.domain.filter.WarrantFilterItem

Structure:

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
NameTypeDescription
pageintPage number
totalPageintTotal pages
totalCountintTotal count
boundstigeropen.quote.domain.filter.WarrantFilterBoundsAvailable filter conditions
itemspandas.DataFrameData fields described below

WarrantFilterBounds object structure:

NameTypeDescription
issuer_namelist[str]Issuer names
expire_datelist[str]Expiry dates
lot_sizelist[int]Lot sizes
entitlement_ratiolist<double>Entitlement ratios
leverage_ratiodictLeverage ratio range
strikedictStrike price range
premiumdictPremium range
outstanding_ratiodictOutstanding ratio range
implied_volatilitydictImplied volatility range
effective_leveragedictEffective leverage range
call_pricedictCall price range

items DataFrame field descriptions:

NameTypeDescription
symbolstrUnderlying stock symbol
namestrUnderlying name
typewarrant_typeType: 1=Call, 2=Put, 3=Bull, 4=Bear
sec_typestrSecurity type: warrant=war, callable=iopt
marketstrMarket: hk
entitlement_ratiofloatEntitlement ratio
entitlement_pricefloatEntitlement price
premiumfloatPremium
breakeven_pointfloatBreakeven point at expiry
call_pricefloatCall price (callable bull/bear certificates only)
before_call_levelfloatDistance to call price (percentage, e.g. 0.196875 means 19.6875%)
expire_datestrExpiry date
last_trading_datestrLast trading date
statewarrant_stateStatus: 1=Normal, 2=Terminated, 3=Pending listing
change_ratefloatChange rate
changefloatChange amount
latest_pricefloatLatest price
volumelongVolume
outstanding_ratiofloatOutstanding ratio
lot_sizeintLot size
strikefloatStrike price
in_out_pricefloatIn-the-money (greater than 0) / Out-of-the-money (less than 0)
deltafloatDelta
leverage_ratiofloatLeverage ratio
effective_leveragefloatEffective leverage
implied_volatilityfloatImplied volatility

Example

from tigeropen.quote.quote_client import QuoteClient
from tigeropen.quote.request.model import WarrantFilterParams

from tigeropen.tiger_open_config import TigerOpenClientConfig
client_config = TigerOpenClientConfig(props_path='/path/to/your/properties/file/')
quote_client = QuoteClient(client_config)

filter_params = WarrantFilterParams()
filter_params.set_issuer_name('Morgan Stanley')
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)

Return 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  Tencent Morgan Stanley Put 30A.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': ['Bank of East Asia', 'BNP Paribas', 'Societe Generale', 'Goldman Sachs', 'Guotai Junan', 'Haitong', 'Citigroup', 'HSBC', 'Macquarie', 'Morgan Stanley', 'J.P.Morgan', 'Commerzbank', 'Credit Suisse', 'UBS', 'DBS', 'Bank of China'], 
    '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 real-time quotes for warrants and callable bull/bear certificates

Parameters

ParameterTypeRequiredDescription
symbolslist[str]yesWarrant symbols, maximum 50

Returns

pandas.DataFrame

Structure:

FieldTypeDescription
symbolstrSymbol
namestrName
exchangestrExchange
marketstrMarket
sec_typestrSecurity type
currencystrCurrency
expirystrExpiry date yyyy_mm_dd
strikestrStrike price
rightstrDirection (put/call)
multiplierfloatMultiplier
last_trading_dateintLast trading date timestamp
entitlement_ratiofloatEntitlement ratio
entitlement_pricefloatEntitlement price
min_tickfloatMinimum tick size
listing_dateintListing date timestamp
call_pricefloatCall price (callable bull/bear certificates only)
haltedhalted_statusHalted status: 0=Normal, 3=Halted, 4=Delisted
underlying_symbolstrUnderlying asset symbol
timestampintTimestamp
latest_pricefloatLatest price
pre_closefloatPrevious close
openfloatOpen price
highfloatHigh price
lowfloatLow price
volumeintVolume
amountfloatTurnover
premiumfloatPremium
outstanding_ratiofloatOutstanding ratio
implied_volatilityfloatImplied volatility (warrants only)
in_out_pricefloatIn/out-of-the-money
deltafloatDelta (warrants only)
leverage_ratiofloatLeverage ratio
breakeven_pointfloatBreakeven point at expiry

Example

from tigeropen.quote.quote_client import QuoteClient
from tigeropen.tiger_open_config import TigerOpenClientConfig
client_config = TigerOpenClientConfig(props_path='/path/to/your/properties/file/')

quote_client = QuoteClient(client_config)

briefs = quote_client.get_warrant_briefs(['15792', '58603'])
print(briefs)

Return Example

symbol        name exchange market sec_type currency      expiry   strike right  multiplier   premium \
 58603  HSI SG Bear R.P  SEHK   HK     IOPT      HKD  2025-03-28  16700.0   PUT     10000.0     \ 
 15792  CMB J.P.Morgan Put A.P  SEHK   HK      WAR      HKD  2022-10-31    39.39   PUT      5000.0     \                      

last_trading_date  entitlement_ratio  entitlement_price  min_tick   listing_date  call_price  halted \
    1743004800000            10000.0            1890.00     0.001  1668009600000     16600.0  Normal 
    1666627200000               10.0               2.28     0.001  1651075200000         NaN  Normal 

underlying_symbol      timestamp  latest_price  pre_close   open   high    low    volume     amount \
              HSI  1681200546054         0.189      0.175  0.188  0.189  0.170    444000    83378.0 
            03968  1681200546030         0.228      0.223  0.227  0.228  0.216  21572000  4795879.0 

 outstanding_ratio  in_out_price  leverage_ratio  breakeven_point  implied_volatility   delta
     0.277040             0.0375      0.226661       10.838751         14810.00       NaN     NaN  
     0.058122             0.0011      0.000254       17.280702            37.11    130.577 -0.9844