Skip to content

持仓列表 ​

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

获取持仓列表(代码、方向、数量、成本、市值、盈亏)。market 必填,传账户列表中该账户的 market_id(美股融资融券账户传 100);与账户不符时返回失败。

请求参数 ​

参数类型位置必填说明
acc_idstringpath是业务账户 ID
marketintquery是账户市场ID(账户列表中该账户的 market_id,如 1=港股 100=美股融资融券),必须与 acc_id 对应账户一致

请求示例 ​

bash
curl -s "https://webapi.futunn.com/api/v1.0/sim-trade/80306533/positions?market=1" -H "Authorization: Bearer <AccessToken>" | jq

响应字段 ​

返回 data.positions[]。

字段类型说明
pstn_idstring持仓 ID
pstn_typeint持仓方向:0=多仓 1=空仓
marketint持仓所属交易品种市场(Market 枚举:1=港股 2=美股 3=美股期权 4=港股通),与账户 market_id 不是同一套编号
symbolstring代码
stock_namestring名称
qtystring数量
qty_avblstring可用数量
cost_pricestring成本价
buy_avg_pricestring均买价
cur_pricestring现价
mvstring市值
profitstring盈亏额
profit_ratiostring盈亏比(百分比数值,-0.08 表示 -0.08%)
unrealized_profitstring/null未实现盈亏(未返回时为 null)
realized_profitstring/null已实现盈亏(未返回时为 null)
today_turnoverstring今日成交额
today_buy_qtystring/null今日买入数量
today_sell_qtystring/null今日卖出数量
today_buy_turnoverstring/null今日买入成交额
today_buy_avg_pricestring/null今日买入均价
today_sell_turnoverstring/null今日卖出成交额
today_sell_avg_pricestring/null今日卖出均价
today_profitstring/null今日盈亏

响应示例 ​

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "positions": [
      {
        "pstn_id": "141990",
        "pstn_type": 0,
        "market": 1,
        "symbol": "02800",
        "stock_name": "TRACKER FUND OF HONG KONG",
        "qty": "500",
        "qty_avbl": "500",
        "cost_price": "24.64",
        "buy_avg_price": "24.64",
        "cur_price": "24.62",
        "mv": "12310",
        "profit": "-10",
        "profit_ratio": "-0.08116883116883117",
        "unrealized_profit": null,
        "realized_profit": null,
        "today_turnover": "-10",
        "today_buy_qty": null,
        "today_sell_qty": null,
        "today_buy_turnover": null,
        "today_buy_avg_price": null,
        "today_sell_turnover": null,
        "today_sell_avg_price": null,
        "today_profit": null
      }
    ]
  }
}

错误响应 ​

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

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