# 最大買い/売り可能数量の照会

acctradinginfo_query(order_type, code, price, order_id=None, adjust_limit=0, trd_env=TrdEnv.REAL, acc_id=0, acc_index=0, session=Session.NONE, jp_acc_type=SubAccType.JP_GENERAL, position_id=NONE)

  • 概要

    指定取引口座の最大買い/売り可能数量を照会します。また、指定注文の最大変更可能数量も照会できます。

    現金口座によるオプションのリクエストは非対応です。

  • パラメータ

    パラメータ 説明
    order_type OrderType 注文タイプ
    code str 証券コード
    price float 価格
    order_id str 注文番号
    adjust_limit float 価格微調整幅
    trd_env TrdEnv 取引環境
    acc_id int 取引口座 ID
    acc_index int 取引口座リスト内の口座インデックス
    session Session 米国株取引時間帯
    jp_acc_type SubAccType 日本口座タイプ
    position_id int ポジションID
  • 戻り値

    パラメータ 説明
    ret RET_CODE API呼び出し結果
    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 1枚の買い注文による初期証拠金変動額。
      short_required_im float 1枚の売り注文による初期証拠金変動額。
      session Session 取引注文時間帯(米国株にのみ使用)
  • Example

from moomoo import *
trd_ctx = OpenSecTradeContext(filter_trdmarket=TrdMarket.US, host='127.0.0.1', port=11111, security_firm=SecurityFirm.FUTUINC)
ret, data = trd_ctx.acctradinginfo_query(order_type=OrderType.NORMAL, code='US.AAPL', 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   session
0           0.0                   1500.0                0.0             0.0           0.0              N/A               N/A            N/A
1500.0
1
2
3

APIレート制限

  • 同一口座ID(acc_id)で30秒以内に最大10回まで最大売買可能数量照会APIをリクエスト可能

ご注意

  • 現金取引口座はデリバティブ取引に対応していないため、現金取引口座でのオプションの最大売買可能数量の照会には対応していません。
  • 先物の最大購入可能数は自分で計算する必要があります。計算式:floor(最大購買力 / 1枚の買い注文による初期証拠金変動額)。最大購買力は口座資金照会から、1枚の買い注文による初期証拠金変動額は本APIから取得できます。