Get Positions
GET/api/v1.0/accounts/{acc_id}/positionsQuery the holding position list of a specific trading account.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
acc_id | string | Yes | Trading business account ID. |
Request Parameters
| Parameter | Type | Position | Required | Description |
|---|---|---|---|---|
code | string | Query | No | Only return positions matching these codes. If not passed, return all. For futures positions, you need to pass the contract code with a specific month; filtering by the main contract code is not supported. |
pl_ratio_min | string | Query | No | Lower limit of current P&L ratio filter. e.g. When 10 is passed, positions with P&L ratio ≥ +10% will be returned. |
pl_ratio_max | string | Query | No | Upper limit of current P&L ratio filter. e.g. When 20 is passed, positions with P&L ratio ≤ +20% will be returned. |
Response Parameters
| Field | Type | Description |
|---|---|---|
position_side | string | Position direction. Values: NONE (Unknown), LONG (Long, default), SHORT (Short). |
code | string | Security code. |
stock_name | string | Security name. |
qty | string | The number of holdings. |
can_sell_qty | string | Available quantity. |
currency | string | Transaction currency. |
nominal_price | string | Market price. |
cost_price | string | Diluted cost (for securities account). Average opening price (for futures account). |
cost_price_valid | bool | Whether the cost price is valid. |
market_val | string | Market value. |
pl_ratio | string | Proportion of gain or loss. |
pl_ratio_valid | bool | Whether the gain or loss ratio is valid. |
pl_val | string | Gain or loss. |
pl_val_valid | bool | Whether the gain or loss is valid. |
today_pl_val | string | Gain or loss today. |
today_trd_val | string | Transaction amount today. |
today_buy_qty | string | Total volume purchased today. |
today_buy_val | string | Total amount purchased today. |
today_sell_qty | string | Total volume sold today. |
today_sell_val | string | Total amount sold today. |
unrealized_pl | string | Unrealized gain or loss. |
realized_pl | string | Realized gain or loss. |
Response Example
json
{
"s": "ok",
"d": [
{
"position_side": "LONG",
"code": "US.AAPL",
"stock_name": "Apple Inc.",
"qty": "100",
"can_sell_qty": "100",
"currency": "USD",
"nominal_price": "185.500",
"cost_price": "180.000",
"cost_price_valid": true,
"market_val": "18550.00",
"pl_ratio": "3.06",
"pl_ratio_valid": true,
"pl_val": "550.00",
"pl_val_valid": true,
"today_pl_val": "50.00",
"today_trd_val": "0.00",
"today_buy_qty": "0",
"today_buy_val": "0.00",
"today_sell_qty": "0",
"today_sell_val": "0.00",
"unrealized_pl": "550.00",
"realized_pl": "200.00"
}
]
}Error Response:
json
{
"s": "error",
"errcode": -1200,
"errmsg": "Error message."
}