獲取持倉
GET/api/v1.0/accounts/{acc_id}/positions查詢指定交易賬戶的持倉列表。
路徑參數
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
acc_id | string | 是 | 業務賬戶 ID。 |
請求參數
| 參數 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
code | string | 查詢 | 否 | 標的代碼過濾,只返回匹配的持倉。不傳則返回全部。期貨持倉需傳帶月份的合約代碼,不支持按主力合約代碼過濾。 |
pl_ratio_min | string | 查詢 | 否 | 盈虧比例下限過濾。傳 10 則返回盈虧比例 ≥ +10% 的持倉。 |
pl_ratio_max | string | 查詢 | 否 | 盈虧比例上限過濾。傳 20 則返回盈虧比例 ≤ +20% 的持倉。 |
asset_category | asset_category | 查詢 | 條件必填 | 資產類別。日本保證金 / 衍生品賬戶必填;日本保證金賬戶不支持 DOMESTIC;非日本券商忽略。 |
響應參數
| 字段 | 類型 | 說明 |
|---|---|---|
position_side | position_side | 持倉方向。 |
code | string | 標的代碼。 |
stock_name | string | 標的名稱。 |
security_type | security_type | 證券類型。 |
qty | string | 持倉數量。 |
can_sell_qty | string | 可賣數量。 |
open_time | uint64 | 開倉時間,Unix 秒時間戳(10 位)。與訂單、成交的微秒時間戳不同。無開倉時間時不返回該字段。 |
position_id | string | 持倉 ID,用於平指定持倉。外匯平倉下單時必填。 |
currency | string | 交易幣種。 |
nominal_price | string | 市價。 |
cost_price | string | 攤薄成本(證券賬戶)。平均開倉價(期貨賬戶)。 |
cost_price_valid | bool | 成本價是否有效。 |
market_val | string | 市值。 |
pl_ratio | string | 盈虧比例。數字字串,不含百分號;"3.06" 表示 +3.06%。 |
pl_ratio_valid | bool | 盈虧比例是否有效。 |
pl_val | string | 盈虧金額。 |
pl_val_valid | bool | 盈虧金額是否有效。 |
today_pl_val | string | 今日盈虧。 |
today_trd_val | string | 今日成交額。 |
today_buy_qty | string | 今日買入總量。 |
today_buy_val | string | 今日買入總額。 |
today_sell_qty | string | 今日賣出總量。 |
today_sell_val | string | 今日賣出總額。 |
unrealized_pl | string | 未實現盈虧。 |
realized_pl | string | 已實現盈虧。 |
sub_acc_type | sub_acc_type | (日本)子賬戶類型。 |
margin_trading_type | margin_trading_type | (日本保證金)信用交易類型。 |
margin_period_type | margin_period_type | (日本保證金)信用交易期限類型。 |
margin_rate | string | (日本保證金)融資利率。 |
collateral_qty | string | (日本現金)抵押數量。 |
covered_qty | string | (日本現金)擔保(借入)數量。 |
響應示例
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
}
]
}