Position List
GET/api/v1.0/sim-trade/{acc_id}/positionsGet 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
| 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 |
Request Example
bash
curl -s "https://webapi.futunn.com/api/v1.0/sim-trade/80306533/positions?market=1" -H "Authorization: Bearer <AccessToken>" | jqResponse Fields
Returns data.positions[].
| Field | Type | Description |
|---|---|---|
pstn_id | string | Position ID |
pstn_type | int | Position direction: 0=long 1=short |
market | int | Instrument market of the position (Market enum: 1=HK 2=US 3=US options 4=HK Connect); not the same numbering as account market_id |
symbol | string | Symbol |
stock_name | string | Name |
qty | string | Quantity |
qty_avbl | string | Available quantity |
cost_price | string | Cost price |
buy_avg_price | string | Average buy price |
cur_price | string | Current price |
mv | string | Market value |
profit | string | P&L amount |
profit_ratio | string | P&L ratio (percentage value; -0.08 means -0.08%) |
unrealized_profit | string/null | Unrealized P&L (null when not returned) |
realized_profit | string/null | Realized P&L (null when not returned) |
today_turnover | string | Today's turnover |
today_buy_qty | string/null | Today's buy quantity |
today_sell_qty | string/null | Today's sell quantity |
today_buy_turnover | string/null | Today's buy turnover |
today_buy_avg_price | string/null | Today's average buy price |
today_sell_turnover | string/null | Today's sell turnover |
today_sell_avg_price | string/null | Today's average sell price |
today_profit | string/null | Today'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"}
}