# 獲取期權快照

get_option_quote(combo_leg_list)

  • 介紹

    根據組合腿列表獲取期權快照行情,適用於多腿策略的批量報價查詢。

  • 參數

    參數 類型 說明
    combo_leg_list list 組合腿列表
  • 返回

    參數 類型 說明
    ret RET_CODE 接口調用結果
    data pd.DataFrame 當 ret == RET_OK,返回期權快照數據
    str 當 ret != RET_OK,返回錯誤描述
    • DataFrame 欄位說明:

      欄位 類型 說明
      price float 組合價格
      change_val float 漲跌額
      change_rate float 漲跌幅
      volume str 成交量
      turnover str 成交額
      high_price str 最高價
      low_price str 最低價
      mid_price str 中間價
      open_price str 開盤價
      last_close_price float 昨收價
      open_interest str 持倉量
      premium str 溢價
      implied_volatility str 隱含波動率
      delta float Delta
      gamma float Gamma
      vega float Vega
      theta float Theta
      rho float Rho
      option_type str 期權類型
      expire_time str 到期日
      strike_price str 行權價
      contract_size float 合約規模
      contract_multiplier float 合約乘數
      exercise_type str 行權方式
      days_to_expiry int 距到期天數
      net_open_interest str 淨未平倉合約數
      contract_value str 合約價值
      equal_underlying str 等價標的
      index_option_type str 指數期權類型
      intrinsic_value float 內在價值
      time_value float 時間價值
      breakeven_point list 盈虧平衡點
      dist_to_breakeven list 距盈虧平衡點距離
      prob_of_profit float 盈利概率
      seller_roi str 賣方收益率
      mark_price float 標記價格
      leverage_ratio str 槓桿比率
      effective_gearing str 有效槓桿
  • Example

from futu import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_option_strategy(code='HK.00700', option_strategy=OptionStrategyType.STRADDLE)
if ret == RET_OK:
    index=0
    print(data['legs'][index])
    ret2,data2 = quote_ctx.get_option_quote(data['legs'][index])
    if ret2 == RET_OK:
        print(data2)
    else:
        print("get_analysis,error:",data2)
else:
    print('error:', data)

quote_ctx.close() # 結束後記得關閉當條連接,防止連接條數用盡
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  • Output
[OptionStrategyLeg(code=HK.TCH260522P330000, action=BUY, quantity=1.0), OptionStrategyLeg(code=HK.TCH260522C330000, action=BUY, quantity=1.0)]
    price  change_val  change_rate volume turnover high_price low_price mid_price open_price  last_close_price open_interest premium implied_volatility     delta     gamma      vega     theta       rho option_type expire_time strike_price  contract_size  contract_multiplier exercise_type  days_to_expiry net_open_interest contract_value equal_underlying index_option_type  intrinsic_value  time_value   breakeven_point             dist_to_breakeven  prob_of_profit seller_roi  mark_price leverage_ratio effective_gearing
0  131.65         0.0          0.0    N/A      N/A        N/A       N/A       N/A        N/A            131.65           N/A     N/A                N/A  0.974369  0.000797  0.019825 -0.785757  0.016246         N/A  2026-05-22          N/A          100.0                100.0           N/A               2               N/A            N/A              N/A               N/A            125.2        6.45  [199.56, 460.44]  [255.64, -5.240000000000009]        0.315418        N/A       130.4            N/A               N/A
1
2
3

接口限制

  • 每 30 秒內最多請求 120 次。