# Set Option Event Alert
set_option_event_alert(op, alert_list=None)
Description
Add, modify, delete, or enable/disable option unusual activity alerts.
Parameters
Parameter Type Description op AlertOpType Operation type alert_list OptionEventAlertItem or list[OptionEventAlertItem] Alert item(s) OptionEventAlertItem fields:
Field Type Description key int Alert unique identifier (required for modify/delete/enable/disable) enable bool Alert switch option_market OptionMarket Option market to monitor (one of three) watchlist_group_name str Watchlist group name (one of three) underlying str Specified underlying code, e.g. 'US.AAPL'(one of three)option_type OptionType Option type (CALL/PUT) side_type_list list[EventTickerType] Trade direction list order_type_list list[AlertOrderType] Order type list market_cap_range_min float Underlying market cap lower bound market_cap_range_max float Underlying market cap upper bound market_cap_min_inclusive bool Whether market cap lower bound is inclusive (default True) market_cap_max_inclusive bool Whether market cap upper bound is inclusive (default True) expiry_days_range_min float Days to expiration lower bound expiry_days_range_max float Days to expiration upper bound expiry_days_min_inclusive bool Whether days to expiration lower bound is inclusive (default True) expiry_days_max_inclusive bool Whether days to expiration upper bound is inclusive (default True) price_range_min float Event fill price lower bound price_range_max float Event fill price upper bound price_min_inclusive bool Whether fill price lower bound is inclusive (default True) price_max_inclusive bool Whether fill price upper bound is inclusive (default True) size_range_min float Event volume lower bound (contracts) size_range_max float Event volume upper bound (contracts) size_min_inclusive bool Whether volume lower bound is inclusive (default True) size_max_inclusive bool Whether volume upper bound is inclusive (default True) premium_range_min float Event turnover lower bound premium_range_max float Event turnover upper bound premium_min_inclusive bool Whether turnover lower bound is inclusive (default True) premium_max_inclusive bool Whether turnover upper bound is inclusive (default True) iv_range_min float Implied volatility lower bound (%) iv_range_max float Implied volatility upper bound (%) iv_min_inclusive bool Whether IV lower bound is inclusive (default True) iv_max_inclusive bool Whether IV upper bound is inclusive (default True) earnings_date_begin str Earnings date filter start date (yyyy-MM-dd) earnings_date_end str Earnings date filter end date (yyyy-MM-dd) note str Note (max 20 characters)
Monitoring scope:
option_market,watchlist_group_name, andunderlyingare mutually exclusive. One must be set when adding a new alert.Returns
Parameter Type Description ret RET_CODE Interface call result data str When ret == RET_OK, returns empty string str When ret != RET_OK, returns error description Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
# Add an alert: monitor US stock option market CALL sweeps, volume > 100 (exclusive)
item = OptionEventAlertItem(
option_market=OptionMarket.US_SECURITY,
option_type=OptionType.CALL,
order_type_list=[AlertOrderType.SWEEP],
size_range_min=100,
size_min_inclusive=False,
note='test'
)
ret, data = quote_ctx.set_option_event_alert(AlertOpType.ADD, item)
if ret == RET_OK:
print('Added successfully')
else:
print('error:', data)
quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- Output
Added successfully
1
Rate Limit
- Maximum 60 requests per 30 seconds for the set option event alert interface