获取历史成交
GET/api/v1.0/accounts/{acc_id}/fills_history查询指定交易业务账户的历史成交列表。
路径参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
acc_id | string | 是 | 业务账户 ID。 |
请求参数
| 参数 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
trd_market | string | 查询 | 是 | 交易市场。可选值参见 命名词典 |
code | string | 查询 | 否 | 代码筛选。返回指定代码的数据,默认返回全部数据。 |
start | uint64 | 查询 | 否 | 更新时间的起始时间,时间戳,单位微秒。 |
end | uint64 | 查询 | 否 | 更新时间的结束时间,应在起始时间之后。时间戳,单位微秒。 |
page_flag | string | 查询 | 是 | 翻页标记,首次请求填空字符串表示从头开始,之后填入服务端返回的 page_flag。 |
page_size | uint32 | 查询 | 否 | 每页条数,默认 50,取值范围 10-50。 |
start 和 end 的组合说明:
| start | end | 说明 |
|---|---|---|
| >0 | >0 | start 和 end 分别为指定日期。 |
| 0 | >0 | start 为 end 之前 90 天。 |
| >0 | 0 | end 为 start 之后 90 天。 |
| 0 | 0 | start 为当前日期之前 90 天,end 为当前日期。 |
响应参数
| 字段 | 类型 | 说明 |
|---|---|---|
order_fills | list[OrderFill] | 成交列表,默认每次返回 50 条,最新成交在前。 |
page_flag | string | 下次请求的翻页标记 |
completed | bool | 为 true 表示所有成交记录已返回,客户端应停止翻页请求。 |
响应示例
json
{
"s": "ok",
"d": {
"order_fills": [
{
"trd_side": "BUY",
"deal_id": "F2024030100000001",
"order_id": "2024030100000001",
"code": "US.AAPL",
"stock_name": "Apple Inc.",
"qty": "100",
"price": "180.000",
"create_time": 1709251210000000,
"updated_time": 1709251210000000,
"counter_broker_id": 9999,
"counter_broker_name": "Goldman Sachs",
"status": "OK"
}
],
"page_flag": "",
"completed": true
}
}失败响应:
json
{
"s": "error",
"errcode": -1200,
"errmsg": "Error message."
}