# Zero DTE Option Contracts

get_option_zero_dte_contract(owner, strike_date_timestamp, chain_info, sort_type=None, is_asc=None, filter_list=None)

  • Description

    Get zero DTE option contract list, returning 0DTE option contract details for a specified underlying on a specified strike date, including Greeks, break-even points, and profit probabilities.

  • Parameters

    Parameter Type Description
    owner str Underlying stock code
    strike_date_timestamp int Strike date timestamp (Unix seconds)
    chain_info dict Option chain information
    sort_type ZeroDteContractSortType Sort type
    is_asc bool Ascending order
    filter_list list[ZeroDteContractFilter] Filter conditions list
  • Returns

    Parameter Type Description
    ret RET_CODE Interface call result
    data pandas.DataFrame When ret == RET_OK, returns contract list
    str When ret != RET_OK, returns error description
    • Return DataFrame fields:

      Field Type Description
      option str Option contract code
      name str Contract name
      option_type str Option type (CALL/PUT)
      option_price float Option price
      change_ratio float Price change (percentage)
      volume int Volume
      open_interest int Open interest
      iv float Implied volatility (percentage)
      delta float Delta
      gamma float Gamma
      vega float Vega
      theta float Theta
      rho float Rho
      buy_break_even_point float Buy break-even point
      buy_to_bep float Price change needed to reach break-even (percentage)
      buy_profit_probability float Buy profit probability (percentage)
      sell_profit_probability float Sell profit probability (percentage)
  • Example

from futu import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

# 第一步:获取末日期权标的列表
ret, screener_data = quote_ctx.get_option_zero_dte_screener(
    market=OptionMarket.US_SECURITY,
    sort_type=ZeroDteSortType.VOLUME,
    is_asc=False,
    count=1
)
if ret != RET_OK:
    print('error:', screener_data)
    quote_ctx.close()
    exit()

# 第二步:取第一个标的的 chain_info,查询其合约列表
df = screener_data['item_list']
owner = df.iloc[0]['owner']
chain_info = df.iloc[0]['chain_info']
strike_date_timestamp = chain_info['strike_date_timestamp']

ret, data = quote_ctx.get_option_zero_dte_contract(
    owner=owner,
    strike_date_timestamp=strike_date_timestamp,
    chain_info=chain_info,
    sort_type=ZeroDteContractSortType.VOLUME,
    is_asc=False
)
if ret == RET_OK:
    print(data)
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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  • Output
              option             name option_type  option_price  change_ratio  volume  open_interest    iv   delta   gamma    vega   theta     rho  buy_break_even_point  buy_to_bep  buy_profit_probability  sell_profit_probability
0  US.SPY260612C742000  SPY 260612 C742        CALL          0.58       -67.688  730160           7449  146.5  0.4367  0.2745  0.0039  -455.46  0.000                742.58        0.11                   43.5                    56.5
1  US.SPY260612C745000  SPY 260612 C745        CALL          0.01       -98.958  617981          17013   87.1  0.0244  0.0350  0.0011   -18.52  0.000                745.01        0.44                    2.4                    97.6
...
1
2
3
4

Rate Limit

  • Maximum 60 requests per 30 seconds