# Warrant Screening V2
get_warrant_screen(request)
Description
Warrant screening V2. Compared with the legacy get_warrant, this API returns 43 columns of warrant attributes, supports HK / Singapore / Malaysia markets, and supports a count-only mode (only_count). All numeric fields accept raw values; OpenD performs magnification conversion internally.
Parameters
Parameter Type Description request WarrantScreenRequest Warrant screening request object; warrant_market must be passed at construction WarrantScreenRequest fields:
Field Type Description warrant_market WarrantMarket Market is_delay bool Whether to use delayed market data only_count bool Whether to return only the total count (no detailed records) page_from int Pagination start position page_count int Maximum results per page Filter builder methods (each call appends one filter condition):
Method Description add_interval_filter(field_id, min_val=None, max_val=None, min_included=True, max_included=True) Interval filter add_choice_filter(field_id, choices) Choice filter add_sort(field_id, desc=False) Sort Common WarrantField field_id (full list see WarrantField):
field_id Meaning Filter type 4 ISSUER_ID choice 5 STOCK_OWNER underlying choice 6 WARRANT_TYPE choice 8 CURRENT_PRICE interval 9 STREET_RATIO interval 10 VOLUME interval 16 LEVERAGE_RATIO interval 19 STATUS choice 23 EFFECTIVE_LEVERAGE interval
Returns
Parameter Type Description ret RET_CODE API result data tuple When ret == RET_OK, returns (last_page, all_count, DataFrame) str When ret != RET_OK, an error description is returned Returned DataFrame fields (43 columns total):
Field Type Description stock_id int Warrant stock ID stock_owner int Underlying stock ID issuer_id int Issuer ID warrant_type int Warrant type strike_price float Strike price maturity_date str Maturity date last_trade_date str Last trade date conversion_ratio float Conversion ratio last_close_price float Previous close price recovery_price float Recovery price (Bull/Bear only) stock_owner_price float Underlying stock price current_price float Current price volume int Volume turnover float Turnover sell_vol int Ask volume buy_vol int Bid volume sell_price float Ask price buy_price float Bid price street_rate float Street ratio high_price float High low_price float Low implied_volatility float Implied volatility (Call/Put only) delta float Delta (Call/Put only) status int Warrant status street_rate_new float Street ratio (new) score float Composite score premium float Premium leverage float Leverage effective_leverage float Effective leverage break_even_point float Break-even point ipop float In/Out of the money amplitude float Amplitude fx_score float SG score ipo_time str IPO time street_vol int Street volume lot_size int Lot size issue_size int Issue size ipo_price float IPO price upper_strike_price float Upper strike price (Inline only) lower_strike_price float Lower strike price (Inline only) iw_price_status int Inside / outside the range sensitivity float Sensitivity price_recovery_ratio float Underlying distance to recovery price (Bull/Bear only)
Example
from futu import (
OpenQuoteContext, RET_OK, WarrantScreenRequest,
WarrantMarket, WarrantField, WarrantType,
)
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
# Example 1: HK low-priced high-leverage Call / Put warrants
req = WarrantScreenRequest(warrant_market=WarrantMarket.HK)
req.add_choice_filter(field_id=WarrantField.WARRANT_TYPE,
choices=[WarrantType.CALL, WarrantType.PUT]) # Call + Put
req.add_interval_filter(field_id=WarrantField.CURRENT_PRICE,
min_val=0.1, max_val=5.0) # Current price 0.1~5
req.add_interval_filter(field_id=WarrantField.EFFECTIVE_LEVERAGE,
min_val=3.0) # Effective leverage > 3
req.add_interval_filter(field_id=WarrantField.STREET_RATIO, max_val=50.0) # Street ratio < 50%
req.add_sort(field_id=WarrantField.VOLUME, desc=True) # Volume descending
req.page_count = 20
ret, data = quote_ctx.get_warrant_screen(req)
if ret == RET_OK:
last_page, all_count, df = data
print(df[['stock_id', 'warrant_type', 'current_price', 'effective_leverage']].head())
else:
print('error: ', data)
# Example 2: Return only the total count of matching records
req = WarrantScreenRequest(warrant_market=WarrantMarket.HK)
req.only_count = True
req.add_choice_filter(field_id=WarrantField.WARRANT_TYPE, choices=[WarrantType.CALL])
req.add_interval_filter(field_id=WarrantField.CURRENT_PRICE, min_val=1.0)
ret, data = quote_ctx.get_warrant_screen(req)
if ret == RET_OK:
_, all_count, _ = data
print(f"Total Call warrants matching: {all_count}")
# Example 3: Filter by underlying stock code (choice accepts code string)
req = WarrantScreenRequest(warrant_market=WarrantMarket.HK)
req.add_choice_filter(field_id=WarrantField.STOCK_OWNER, choices=["HK.00700"])
req.add_choice_filter(field_id=WarrantField.WARRANT_TYPE,
choices=[WarrantType.BULL, WarrantType.BEAR]) # Bull + Bear
req.add_sort(field_id=WarrantField.TURNOVER, desc=True)
req.page_count = 50
ret, data = quote_ctx.get_warrant_screen(req)
quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- Output
stock_id warrant_type current_price effective_leverage
0 87930865475960 1 0.107 4.337
1 87939455410698 1 0.108 4.307
2 88231513189723 1 0.120 4.996
3 87969520182112 1 0.110 3.604
4 88356067241952 1 0.127 6.827
Total Call warrants matching: 98
1
2
3
4
5
6
7
2
3
4
5
6
7