# 查询最大可买可卖

# acctradinginfo_query

acctradinginfo_query(order_type, code, price, order_id=None, adjust_limit=0, trd_env=TrdEnv.REAL, acc_id=0, acc_index=0)

  • 介绍

    查询指定交易业务账户下的最大可买卖数量,亦可查询指定交易业务账户下指定订单的最大可改成的数量。

    现金账户请求期权不适用。

  • 参数

    参数 类型 说明
    order_type OrderType 订单类型
    code str 证券代码
    price float 报价
    order_id str 订单号
    adjust_limit float 价格微调幅度
    trd_env TrdEnv 交易环境
    acc_id int 交易业务账户 ID
    acc_index int 交易业务账户列表中的账户序号
  • 返回

    参数 类型 说明
    ret RET_CODE 接口调用结果
    data pd.DataFrame 当 ret == RET_OK 时,返回账号列表
    str 当 ret != RET_OK 时,返回错误描述
    • 账号列表格式如下:
      字段 类型 说明
      max_cash_buy float 现金可买
      max_cash_and_margin_buy float 最大可买
      max_position_sell float 持仓可卖
      max_sell_short float 可卖空
      max_buy_back float 平仓需买入
      long_required_im float 开多仓每张合约初始保证金
      short_required_im float 开空仓每张合约初始保证金
  • Example

from futu import *
trd_ctx = OpenSecTradeContext(filter_trdmarket=TrdMarket.HK, host='127.0.0.1', port=11111, security_firm=SecurityFirm.FUTUSECURITIES)
ret, data = trd_ctx.acctradinginfo_query(order_type=OrderType.NORMAL, code='HK.00700', price=400)
if ret == RET_OK:
    print(data)
    print(data['max_cash_and_margin_buy'][0])  # 最大融资可买数量
else:
    print('acctradinginfo_query error: ', data)
trd_ctx.close()  # 关闭当条连接
1
2
3
4
5
6
7
8
9
  • Output
    max_cash_buy  max_cash_and_margin_buy  max_position_sell  max_sell_short  max_buy_back long_required_im short_required_im
0           0.0                   1500.0                0.0             0.0           0.0              N/A               N/A
1500.0
1
2
3

接口限制

  • 每 30 秒内最多请求 10 次查询最大可买可卖接口

提示

  • 现金业务账户不支持交易衍生品,因此不支持通过现金业务账户查询期权的最大可买可卖。