持仓列表
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"
}
]
}
}