查詢移倉歷史
您可以通過使用母帳戶的api key查詢過去的移倉歷史紀錄
信息
本期暫不支持統一帳戶2.0 反向合約移倉
HTTP 請求
GET /v5/position/move-history
請求參數
| 參數 | 是否必需 | 類型 | 說明 |
|---|---|---|---|
| category | false | string | 產品類型linear, spot, option |
| symbol | false | string | 合約名稱/幣對名 |
| startTime | false | number | 創建訂單的開始時間戳 (毫秒), startTime和endTime的時間範圍是7天 |
| endTime | false | number | 創建訂單的結束時間戳 (毫秒), startTime和endTime的時間範圍是7天 |
| status | false | string | Order status. Processing, Filled, Rejected |
| blockTradeId | false | string | 大宗交易訂單ID |
| limit | false | string | 每頁數量限制. [1, 200]. 默認: 20 |
| cursor | false | string | 游標,用於翻頁. 請使用響應中的nextPageCursor的獲得下一頁 |
響應參數
| 參數 | 類型 | 說明 |
|---|---|---|
| list | array | Object |
| > blockTradeId | string | 大宗交易ID |
| > category | string | 產品類型linear, spot, option |
| > orderId | string | Bybit側的訂單ID |
| > userId | integer | 用戶ID |
| > symbol | string | 合約名稱 |
| > side | string | 從taker角度看的訂單方向. Buy, Sell |
| > price | string | 訂單價格 |
| > qty | string | 訂單數量 |
| > execFee | string | 成交費用 |
| > status | string | 大宗交易訂單狀態. Processing, Filled, Rejected |
| > execId | string | 交易所側的成交ID |
| > resultCode | integer | 錯誤碼. 0表示成功 |
| > resultMessage | string | 錯誤信息. 當resultCode=0時, 則返回"" |
| > createdAt | number | 訂單創建時間戳 (毫秒) |
| > updatedAt | number | 訂單更新時間戳 (毫秒) |
| > rejectParty | string |
|
| nextPageCursor | string | 游標, 用於翻下一頁 |
請求示例
- HTTP
- Python
- Java
- Node.js
GET /v5/position/move-history?limit=1&status=Filled HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1697523024244
X-BAPI-RECV-WINDOW: 5000
import com.bybit.api.client.domain.*;
import com.bybit.api.client.domain.position.*;
import com.bybit.api.client.domain.position.request.*;
import com.bybit.api.client.service.BybitApiClientFactory;
var client = BybitApiClientFactory.newInstance().newAsyncPositionRestClient();
var movePositionsHistoryRequest = PositionDataRequest.builder().category(CategoryType.LINEAR).symbol("BTCUSDT").status(MovePositionStatus.Processing).build();
System.out.println(client.getMovePositionHistory(movePositionsHistoryRequest));
響應示例
{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"blockTradeId": "1a82e5801af74b67b7ad71ba00a7391a",
"category": "option",
"orderId": "8e09c5b8-f651-4cec-968d-52764cac11ec",
"userId": 592324,
"symbol": "BTC-14OCT23-27000-C",
"side": "Buy",
"price": "6",
"qty": "0.99",
"execFee": "0",
"status": "Filled",
"execId": "677ad344-6bb4-4ace-baca-128fcffcaca7",
"resultCode": 0,
"resultMessage": "",
"createdAt": 1697186522865,
"updatedAt": 1697186523289,
"rejectParty": ""
}
],
"nextPageCursor": "page_token%3D1241742%26"
},
"retExtInfo": {},
"time": 1697523024386
}