Skip to content

Query Max Tradable Quantity

GET /api/v1.0/accounts/{acc_id}/acctradinginfo

Query the maximum quantity that can be bought or sold under a specific trading account, and you can also query the maximum changeable quantity of a specific order.

Path Parameters

ParameterTypeRequiredDescription
acc_idstringYesTrading business account ID.

Request Parameters

ParameterTypePositionRequiredDescription
codestringQueryYesSymbol code. Format: exchange.symbol, e.g. US.AAPL
pricestringQueryNoPrice of a non-market order. For securities accounts, accurate to 3 decimal places. For futures accounts, accurate to 9 decimal places. Excess will be discarded.
order_typestringQueryYesOrder type. See Naming Dictionary
order_idstringQueryNoOrder ID. By default, using empty string to query the maximum available quantity for new orders. If an order needs modifying, the order_id needs to be transmitted. If you use this parameter to query the maximum quantity, you need to call this interface again after placing an order, with an interval of more than 0.5 seconds.

Response Parameters

FieldTypeDescription
max_cash_buystringBuy on cash
max_cash_and_margin_buystringBuy on margin
max_position_sellstringSell on position
max_sell_shortstringShort sell
max_buy_backstringShort positions
long_required_imstringInitial margin change when buying one contract of an asset
short_required_imstringInitial margin change when selling one contract of an asset

Response Example

json
{
  "s": "ok",
  "d": {
    "max_cash_buy": "100",
    "max_cash_and_margin_buy": "200",
    "max_position_sell": "50",
    "max_sell_short": "0",
    "max_buy_back": "0",
    "long_required_im": "1800.000000000",
    "short_required_im": "0.000000000"
  }
}

Error Response:

json
{
  "s": "error",
  "errcode": -1200,
  "errmsg": "Error message."
}