獲取歷史成交
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."
}