Skip to content

Max Buy/Sell Quantity ​

GET /api/v1.0/sim-trade/{acc_id}/max-buy-sell

Query the maximum buy/sell quantity for a security.

Parameters ​

ParameterTypeLocationRequiredDescription
acc_idstringpathYesBusiness account ID
marketintqueryYesAccount market ID (the account's market_id from the account list, e.g. 1=HK stocks 100=US margin); must match the account of acc_id
symbolstringqueryYesSymbol as MARKET.CODE (e.g. US.AAPL, US.AAPL261120C275000) or without the market prefix
order_typeintqueryYesOrder type: 1=limit 3=market
pricestringqueryNoOrder price (required for limit orders; may be omitted for market orders)
order_idstringqueryNoOriginal order ID (for modification)

Request Example ​

bash
curl -s "https://webapi.moomoo.com/api/v1.0/sim-trade/80306537/max-buy-sell?market=100&symbol=US.AAPL&order_type=1&price=1" -H "Authorization: Bearer <AccessToken>" | jq

Response Fields ​

FieldTypeDescription
max_cash_buy_qty_round_lotstringCash buy quantity (round lot)
max_margin_buy_qty_round_lotstring/nullMax cash+margin buy quantity rounded to lot size (null for non-margin accounts)
max_sell_qty_round_lotstringSell quantity (round lot)
max_sell_short_qtystringShort sell quantity
max_buy_back_qtystringBuy back quantity
required_im_longstring/nullInitial margin required for futures LONG open (null for non-futures accounts)
required_im_shortstring/nullInitial margin required for futures SHORT open (null for non-futures accounts)

Response Example ​

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "max_cash_buy_qty_round_lot": "999999",
    "max_margin_buy_qty_round_lot": "1999999",
    "max_sell_qty_round_lot": "0",
    "max_sell_short_qty": "4868",
    "max_buy_back_qty": "0",
    "required_im_long": null,
    "required_im_short": null
  }
}

Error response ​

HTTP status remains 200. A failed request returns ret_code != 0 and an error object.

json
{
  "ret_code": -3,
  "ret_msg": "invalid request",
  "error": {"code": "invalid_parameter", "message": "invalid request"}
}