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. |
asset_category | asset_category | Query | Conditional | Asset category. Required for JP margin / derivative accounts. JP margin accounts do not support DOMESTIC. Ignored by non-JP brokers. |
Response Parameters
| Field | Type | Description |
|---|---|---|
position_side | position_side | Position side. |
code | string | Security code. |
stock_name | string | Security name. |
security_type | security_type | Instrument type. |
qty | string | The number of holdings. |
can_sell_qty | string | Available quantity. |
open_time | uint64 | Position open time, Unix timestamp in seconds (10 digits). Unlike order and fill timestamps, this is not microseconds. Omitted when unavailable. |
position_id | string | Position ID used to close a specific position. Required when placing a forex close order. |
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 | P/L ratio. Numeric string without a percent sign; "3.06" means +3.06%. |
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. |
sub_acc_type | sub_acc_type | (JP) Sub-account type. |
margin_trading_type | margin_trading_type | (JP margin) Margin (credit) trading type. |
margin_period_type | margin_period_type | (JP margin) Margin (credit) period type. |
margin_rate | string | (JP margin) Margin rate. |
collateral_qty | string | (JP Cash) Collateralized quantity. |
covered_qty | string | (JP Cash) Secured (borrowed) quantity. |
Response Example
json
{
"s": "ok",
"d": [
{
"position_side": "LONG",
"code": "HK.00700",
"stock_name": "TENCENT",
"qty": "2100",
"can_sell_qty": "2100",
"currency": "HKD",
"nominal_price": "387.600",
"cost_price": "443.381",
"cost_price_valid": true,
"market_val": "813960.00",
"pl_ratio": "-12.58",
"pl_ratio_valid": true,
"pl_val": "-117140.0000",
"pl_val_valid": true,
"today_pl_val": "4720.0000",
"today_trd_val": "38840.0000",
"today_buy_qty": "100",
"today_buy_val": "38840.0000",
"today_sell_qty": "0",
"today_sell_val": "0",
"unrealized_pl": "-1500807.8531",
"realized_pl": "1383667.8531",
"security_type": "STOCK",
"open_time": 1791538873
}
]
}