持倉列表
GET/api/v1.0/sim-trade/{acc_id}/positions獲取持倉列表(代碼、方向、數量、成本、市值、盈虧)。
請求參數
| 參數 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
acc_id | string | path | 是 | 業務賬戶 ID |
market | int | query | 否 | 市場過濾 |
請求示例
bash
curl -s "https://webapi.moomoo.com/api/v1.0/sim-trade/80303779/positions" | jq響應字段
返回 data.positions[]。
| 字段 | 類型 | 說明 |
|---|---|---|
pstn_id | string | 持倉 ID |
pstn_type | int | 0=多倉 1=空倉 |
market | int | 市場 |
symbol | string | 代碼 |
stock_name | string | 名稱 |
qty | string | 數量 |
qty_avbl | string | 可用數量 |
cost_price | string | 成本價 |
buy_avg_price | string | 均買價 |
cur_price | string | 現價 |
mv | string | 市值 |
profit | string | 盈虧額 |
profit_ratio | string | 盈虧比 |
響應示例
json
{
"ret_code": 0,
"data": {
"positions": [
{
"pstn_id": "133969",
"pstn_type": 0,
"market": 1,
"symbol": "00700",
"stock_name": "騰訊控股",
"qty": "100",
"qty_avbl": "100",
"cost_price": "448.2",
"cur_price": "448",
"mv": "44800",
"profit": "-20",
"profit_ratio": "-0.0446"
}
]
}
}