Skip to content

持仓列表 ​

GET /api/v1.0/sim-trade/{acc_id}/positions

获取持仓列表(代码、方向、数量、成本、市值、盈亏)。

请求参数 ​

参数类型位置必填说明
acc_idstringpath是业务账户 ID
marketintquery否市场过滤

请求示例 ​

bash
curl -s "https://webapi.moomoo.com/api/v1.0/sim-trade/80303779/positions" -H "Authorization: Bearer <AccessToken>" | jq

响应字段 ​

返回 data.positions[]。

字段类型说明
pstn_idint64持仓 ID
pstn_typestringJSON 返回枚举名称(数值 0=多仓、1=空仓)
marketstring市场
symbolstring代码
stock_namestring名称
qtyint64数量
qty_avblint64可用数量
cost_pricenumber成本价
buy_avg_pricenumber均买价
cur_pricenumber现价
mvstring市值
profitstring盈亏额
profit_rationumber盈亏比
unrealized_profitstring未实现盈亏
realized_profitstring已实现盈亏
today_turnovernumber今日成交额
today_buy_qtyint64今日买入数量
today_sell_qtyint64今日卖出数量
today_buy_turnovernumber今日买入成交额
today_buy_avg_pricenumber今日买入均价
today_sell_turnovernumber今日卖出成交额
today_sell_avg_pricenumber今日卖出均价
today_profitstring今日盈亏

响应示例 ​

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "positions": [
      {
        "pstn_id": 133969,
        "pstn_type": "LONG",
        "market": "HK_STOCK",
        "symbol": "00700",
        "stock_name": "腾讯控股",
        "qty": 100,
        "qty_avbl": 100,
        "cost_price": 448.2,
        "cur_price": 448,
        "mv": "44800",
        "profit": "-20",
        "profit_ratio": -0.0446
      }
    ]
  }
}

错误响应 ​

HTTP 状态始终为 200。请求失败时返回非 0 的 ret_code 和 error 对象。

json
{
  "ret_code": -3,
  "ret_msg": "invalid request",
  "error": {"code": "invalid_parameter", "message": "invalid request"}
}