Max Buy/Sell Quantity
GET/api/v1.0/sim-trade/{acc_id}/max-buy-sellQuery the maximum buy/sell quantity for a security.
Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
acc_id | string | path | Yes | Business account ID |
market | int | query | Yes | Account 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 |
symbol | string | query | Yes | Symbol as MARKET.CODE (e.g. US.AAPL, US.AAPL261120C275000) or without the market prefix |
order_type | int | query | Yes | Order type: 1=limit 3=market |
price | string | query | No | Order price (required for limit orders; may be omitted for market orders) |
order_id | string | query | No | Original 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>" | jqResponse Fields
| Field | Type | Description |
|---|---|---|
max_cash_buy_qty_round_lot | string | Cash buy quantity (round lot) |
max_margin_buy_qty_round_lot | string/null | Max cash+margin buy quantity rounded to lot size (null for non-margin accounts) |
max_sell_qty_round_lot | string | Sell quantity (round lot) |
max_sell_short_qty | string | Short sell quantity |
max_buy_back_qty | string | Buy back quantity |
required_im_long | string/null | Initial margin required for futures LONG open (null for non-futures accounts) |
required_im_short | string/null | Initial 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"}
}