Warrants & CBBCs

get_warrant_filter Warrant Filter

value QuoteClient::get_warrant_filter(const utility::string_t symbol, int page, int page_size, utility::string_t sort_field_name, utility::string_t sort_dir, value filter_params)

Description

Get warrants and CBBCs (Callable Bull/Bear Contracts) quote list data, supporting sorting by different fields and filtering warrants.

Parameters

ParameterTypeRequiredDescription
symbolutility::string_tYesUnderlying stock symbol
pageintNoPage number, starting from 0, default 0
page_sizeintNoItems per page, default 50
sort_field_nameutility::string_tNoSort field, default expireDate (refer to fields in the return object)
sort_dirutility::string_tNoSort order, U("ASC") or U("DESC"), default ASC
filter_paramsvalueNoFilter parameters JSON object, default value::null()

filter_params Filter Parameters

FieldTypeDescription
issuer_namestringIssuer (refer to issuerName field in bounds of the return), default all
expire_ymstringExpiry date, format yyyy-MM
stateintStatus: 0 All, 1 Normal, 2 Terminated, 3 Waiting to be listed, default 0
warrant_typearray[int]Type (1: Call, 2: Put, 3: Bull, 4: Bear, 0: All), default all
in_out_pricearray[int]1: In-the-money (including at-the-money), -1: Out-of-the-money
lot_sizearray[int]Shares per lot
entitlement_ratioarray[double]Entitlement ratio
strike_mindoubleMinimum strike price
strike_maxdoubleMaximum strike price
effective_leverage_mindoubleMinimum effective leverage
effective_leverage_maxdoubleMaximum effective leverage
leverage_ratio_mindoubleMinimum leverage ratio
leverage_ratio_maxdoubleMaximum leverage ratio
call_price_mindoubleMinimum call price
call_price_maxdoubleMaximum call price
volume_minintMinimum volume
volume_maxintMaximum volume
premium_mindoubleMinimum premium
premium_maxdoubleMaximum premium
outstanding_ratio_mindoubleMinimum outstanding ratio
outstanding_ratio_maxdoubleMaximum outstanding ratio
implied_volatility_mindoubleMinimum implied volatility
implied_volatility_maxdoubleMaximum implied volatility

Return

web::json::value JSON object

Return field descriptions:

NameTypeDescription
pageintPage number
totalPageintTotal pages
totalCountintTotal data count
boundsobjectAvailable filter conditions for the request, see below
itemsarrayWarrant data list, fields described below

bounds object structure:

NameTypeDescription
issuer_namearray[string]Issuer names
expire_datearray[string]Expiry dates
lot_sizearray[int]Shares per lot
entitlement_ratioarray[double]Entitlement ratios
leverage_ratioobjectLeverage ratio range
strikeobjectStrike price range
premiumobjectPremium range
outstanding_ratioobjectOutstanding ratio range
implied_volatilityobjectImplied volatility range
effective_leverageobjectEffective leverage range
call_priceobjectCall price range

items array element field descriptions:

NameTypeDescription
symbolstringSymbol code
namestringName
typeintType: 1 Call, 2 Put, 3 Bull, 4 Bear
sec_typestringSecurity type, warrant: war / CBBC: iopt
marketstringMarket, hk
entitlement_ratiodoubleEntitlement ratio
entitlement_pricedoubleEntitlement price
premiumdoublePremium
breakeven_pointdoubleBreakeven point at expiry
call_pricedoubleCall price (CBBCs only)
before_call_leveldoubleDistance to call price (percentage, e.g., 0.196875 means 19.6875%)
expire_datestringExpiry date
last_trading_datestringLast trading date
stateintStatus: 1 Normal, 2 Terminated, 3 Waiting to be listed
change_ratedoubleChange rate
changedoublePrice change
latest_pricedoubleLatest price
volumelongVolume
outstanding_ratiodoubleOutstanding ratio
lot_sizeintShares per lot
strikedoubleStrike price
in_out_pricedoubleIn-the-money (great than 0) / Out-of-the-money (less than 0)
deltadoubleDelta
leverage_ratiodoubleLeverage ratio
effective_leveragedoubleEffective leverage
implied_volatilitydoubleImplied volatility

Example

#include "tigerapi/quote_client.h"
#include "tigerapi/client_config.h"

using namespace TIGER_API;

ClientConfig config(false, U("/path/to/your/properties/"));
QuoteClient quote_client(config);

// Build filter parameters
value filter_params = value::object();
filter_params[U("issuer_name")] = value::string(U("ML"));
filter_params[U("expire_ym")] = value::string(U("2024-06"));
// 0 All, 1 Normal, 2 Terminate Trades, 3 Waiting to be listed
filter_params[U("state")] = value::number(1);

value lot_size_arr = value::array();
lot_size_arr[0] = value::number(1000);
lot_size_arr[1] = value::number(5000);
filter_params[U("lot_size")] = lot_size_arr;

// -1: out the money, 1: in the money
value in_out_price_arr = value::array();
in_out_price_arr[0] = value::number(1);
in_out_price_arr[1] = value::number(-1);
filter_params[U("in_out_price")] = in_out_price_arr;

// 1: Call, 2: Put, 3: Bull, 4: Bear, 0: All
value warrant_type_arr = value::array();
warrant_type_arr[0] = value::number(2);
warrant_type_arr[1] = value::number(4);
filter_params[U("warrant_type")] = warrant_type_arr;

filter_params[U("premium_min")] = value::number(0.0);
filter_params[U("premium_max")] = value::number(1.0);
filter_params[U("strike_min")] = value::number(100.0);
filter_params[U("strike_max")] = value::number(500.0);
filter_params[U("implied_volatility_min")] = value::number(1.0);
filter_params[U("implied_volatility_max")] = value::number(100.0);

value result = quote_client.get_warrant_filter(
    U("00700"), 0, 10,
    U("implied_volatility"), U("DESC"),
    filter_params);
ucout << result.serialize() << std::endl;

get_warrant_briefs Get Warrant Quotes

value QuoteClient::get_warrant_briefs(const value &symbols)

Description

Get real-time warrant and CBBC quotes

Parameters

ParameterTypeRequiredDescription
symbolsvalueYesWarrant symbol code array, max 50, e.g., value::array({value::string(U("15792"))})

Return

web::json::value JSON object

Return field descriptions:

FieldTypeDescription
symbolstringSymbol code
namestringName
exchangestringExchange
marketstringMarket
sec_typestringSecurity type
currencystringCurrency
expirystringExpiry date yyyy-mm-dd
strikestringStrike price
rightstringDirection (put/call)
multiplierdoubleLot size
last_trading_datelongLast trading date timestamp
entitlement_ratiodoubleEntitlement ratio
entitlement_pricedoubleEntitlement price
min_tickdoubleMinimum tick size
listing_datelongListing date timestamp
call_pricedoubleCall price (CBBCs only)
haltedintWhether halted. 0: Normal, 3: Halted, 4: Delisted
underlying_symbolstringUnderlying asset symbol
timestamplongTimestamp
latest_pricedoubleLatest price
pre_closedoublePrevious close price
opendoubleOpen price
highdoubleHigh price
lowdoubleLow price
volumeintVolume
amountdoubleTurnover
premiumdoublePremium
outstanding_ratiodoubleOutstanding ratio
implied_volatilitydoubleImplied volatility (warrants only)
in_out_pricedoubleIn/out of the money
deltadoubleDelta (warrants only)
leverage_ratiodoubleLeverage ratio
breakeven_pointdoubleBreakeven point at expiry

Example

#include "tigerapi/quote_client.h"
#include "tigerapi/client_config.h"

using namespace TIGER_API;

ClientConfig config(false, U("/path/to/your/properties/"));
QuoteClient quote_client(config);

value symbols = value::array();
symbols[0] = value::string(U("15792"));
symbols[1] = value::string(U("58603"));

value result = quote_client.get_warrant_briefs(symbols);
ucout << result.serialize() << std::endl;