# 查詢組合可交易資訊

comboorder_tradinginfo_query(combo_leg_list, price, qty, order_type=OrderType.NORMAL, order_id=None, trd_env=TrdEnv.REAL, acc_id=0, acc_index=0)

  • 介紹

    查詢指定組合訂單在指定價格、數量下的可交易資訊(如保證金、購買力等變動),亦可傳入訂單號查詢改單場景下的可交易資訊。

  • 參數

    參數 類型 說明
    combo_leg_list list 組合腿列表
    price float 報價
    qty float 數量
    order_type OrderType 訂單類型
    order_id str 訂單號
    trd_env TrdEnv 交易環境
    acc_id int 交易業務賬戶 ID
    acc_index int 交易業務賬戶列表中的賬戶序號
  • 返回

    參數 類型 說明
    ret RET_CODE 介面執行結果
    data pd.DataFrame 當 ret == RET_OK 時,返回可交易資訊
    str 當 ret != RET_OK 時,返回錯誤描述
    • 可交易資訊格式如下:
      欄位 類型 說明
      nlv_change float 綜合淨資產變動
      initial_margin_change float 初始保證金變動
      maintenance_margin_change float 維持保證金變動
      option_bp float 期權購買力
      max_withdraw_change float 最大可提變動
      bp_decrease float 消耗購買力
  • Example

from futu import *
trd_ctx = OpenSecTradeContext(filter_trdmarket=TrdMarket.US, host='127.0.0.1', port=11111, security_firm=SecurityFirm.FUTUSECURITIES)
leg1 = ComboLeg()
leg1.code = 'US.AAPL260529C302500'
leg1.trd_side = TrdSide.BUY
leg1.qty_ratio = 1
leg2 = ComboLeg()
leg2.code = 'US.AAPL'
leg2.trd_side = TrdSide.SELL
leg2.qty_ratio = 100
combo_legs = [leg1, leg2]
ret, data = trd_ctx.comboorder_tradinginfo_query(combo_legs, price=100, qty=1, order_type=OrderType.NORMAL, trd_env=TrdEnv.SIMULATE)
if ret == RET_OK:
    print(data)
else:
    print('comboorder_tradinginfo_query error: ', data)
trd_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  • Output
   nlv_change  initial_margin_change  maintenance_margin_change  option_bp  max_withdraw_change  bp_decrease
0        ...                    ...                        ...        ...                  ...          ...
1
2

介面限制

  • 同一賬戶 ID(acc_id) 每 30 秒內最多請求 10 次查詢最大可買可賣類介面。