# 查询组合可交易信息

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 次查询最大可买可卖类接口。