Skip to content

Position List ​

GET /api/v1.0/sim-trade/{acc_id}/positions

Get the position list (symbol, direction, quantity, cost, market value, P&L). market is required: pass the account's market_id from the account list (100 for the US margin account). A mismatched market returns an error.

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

Request Example ​

bash
curl -s "https://webapi.futunn.com/api/v1.0/sim-trade/80306533/positions?market=1" -H "Authorization: Bearer <AccessToken>" | jq

Response Fields ​

Returns data.positions[].

FieldTypeDescription
pstn_idstringPosition ID
pstn_typeintPosition direction: 0=long 1=short
marketintInstrument market of the position (Market enum: 1=HK 2=US 3=US options 4=HK Connect); not the same numbering as account market_id
symbolstringSymbol
stock_namestringName
qtystringQuantity
qty_avblstringAvailable quantity
cost_pricestringCost price
buy_avg_pricestringAverage buy price
cur_pricestringCurrent price
mvstringMarket value
profitstringP&L amount
profit_ratiostringP&L ratio (percentage value; -0.08 means -0.08%)
unrealized_profitstring/nullUnrealized P&L (null when not returned)
realized_profitstring/nullRealized P&L (null when not returned)
today_turnoverstringToday's turnover
today_buy_qtystring/nullToday's buy quantity
today_sell_qtystring/nullToday's sell quantity
today_buy_turnoverstring/nullToday's buy turnover
today_buy_avg_pricestring/nullToday's average buy price
today_sell_turnoverstring/nullToday's sell turnover
today_sell_avg_pricestring/nullToday's average sell price
today_profitstring/nullToday's P&L

Response Example ​

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "positions": [
      {
        "pstn_id": "141990",
        "pstn_type": 0,
        "market": 1,
        "symbol": "02800",
        "stock_name": "TRACKER FUND OF HONG KONG",
        "qty": "500",
        "qty_avbl": "500",
        "cost_price": "24.64",
        "buy_avg_price": "24.64",
        "cur_price": "24.62",
        "mv": "12310",
        "profit": "-10",
        "profit_ratio": "-0.08116883116883117",
        "unrealized_profit": null,
        "realized_profit": null,
        "today_turnover": "-10",
        "today_buy_qty": null,
        "today_sell_qty": null,
        "today_buy_turnover": null,
        "today_buy_avg_price": null,
        "today_sell_turnover": null,
        "today_sell_avg_price": null,
        "today_profit": 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"}
}