# Query Combo Order Tradable Info

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)

  • Description

    Query tradable info for a combo order at the given price and quantity (e.g. margin and buying power changes). You can also pass an order ID to query tradable info for order modification.

  • Parameters

    Parameter Type Description
    combo_leg_list list Combo leg list
    price float Quoted price
    qty float Quantity
    order_type OrderType Order type
    order_id str Order ID
    trd_env TrdEnv Trading environment
    acc_id int Trading account ID
    acc_index int Account index in the trading account list
  • Return

    Field Type Description
    ret RET_CODE Interface result.
    data pd.DataFrame If ret == RET_OK, tradable info is returned.
    str If ret != RET_OK, error description is returned.
    • Tradable info format as follows:
      Field Type Description
      nlv_change float Net liquidation value change
      initial_margin_change float Initial margin change
      maintenance_margin_change float Maintenance margin change
      option_bp float Option buying power
      max_withdraw_change float Max withdrawable change
      bp_decrease float Buying power decrease
  • 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

Interface Limitations

  • A maximum of 10 requests per 30 seconds under a single account ID (acc_id) for max tradable quantity query APIs.