跳至主要内容

查詢策略訂單列表

查詢指定策略產生的子訂單列表。

HTTP 請求

GET/v5/strategy/order-list

請求參數

參數是否必需類型說明
strategyIdtruestring策略 ID
statusfalsestring訂單狀態篩選。2:創建成功,3:創建失敗,4:部分成交,5:全部成交,6:拒絕,7:已取消
symbolfalsestring交易對名稱,例如 BTCUSDT
strategyTypefalsestring策略類型。twapchaseOrdericeberg
beginTimeE0falseint64起始時間(Unix 時間戳,秒)
endTimeE0falseint64結束時間(Unix 時間戳,秒)
pageSizefalseinteger每頁資料筆數。默認:20
cursorfalsestring分頁游標,從上一次響應中返回

響應參數

參數類型說明
listarray物件
> strategyIdstring所屬策略 ID
> orderIdstring訂單 ID(交易所分配)
> symbolstring交易對名稱
> sidestringBuySell
> sizestring訂單數量
> pricestring訂單價格
> statusstring訂單狀態。2:創建成功,3:創建失敗,4:部分成交,5:全部成交,6:拒絕,7:已取消
> executedSizestring已成交數量
> dealTimeE3int64成交時間(毫秒)。0 表示尚未成交
> parentOrderIdstring父訂單 ID。用於補單場景,標識原始訂單
> createdTimeE3int64訂單創建時間(毫秒)
> updatedTimeE3int64訂單最後更新時間(毫秒)
> codeinteger錯誤碼。0 表示成功
> msgstring錯誤信息
> categorystring產品類型
> positionIdxinteger持倉方向索引。0:單向持倉,1:雙向持倉多頭,2:雙向持倉空頭
> orderTypeinteger訂單類型。1:市價單,2:限價單
> leverageTypeinteger槓桿類型。0:普通,1:借貸
> tpPricestring訂單止盈價格
> slPricestring訂單止損價格
> orderPriceOffsetstring限價單價格偏移百分比
> positionValuestring總持倉價值
> filledPositionValuestring已成交持倉價值
nextCursorstring下一頁游標。空字串表示無更多資料
prevCursorstring上一頁游標

請求示例

GET /v5/strategy/order-list?strategyId=119b6211-2611-461b-be5e-5ac557099e82&pageSize=2 HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1773718074685
X-BAPI-RECV-WINDOW: 5000

響應示例

{
"retCode": 0,
"retMsg": "success",
"result": {
"list": [
{
"strategyId": "119b6211-2611-461b-be5e-5ac557099e82",
"orderId": "d67e97b1-7a6e-4a89-b9d7-098756e8b86f",
"symbol": "BTCUSDT",
"side": "Buy",
"size": "0.004",
"price": "",
"status": "3",
"executedSize": "0",
"dealTimeE3": "0",
"parentOrderId": "276a053f-fedf-4834-bbab-d5fc3bc0dc94",
"createdTimeE3": "1773713015709",
"updatedTimeE3": "1773713020768",
"code": 30208,
"msg": "Failed to submit order(s). The order price is higher than the maximum buying price.",
"category": "UTA_USDT",
"positionIdx": 0,
"leverageType": 0,
"tpPrice": "",
"slPrice": "",
"orderType": "UNKNOWN",
"orderPriceOffset": "0",
"positionValue": "",
"filledPositionValue": ""
},
{
"strategyId": "119b6211-2611-461b-be5e-5ac557099e82",
"orderId": "276a053f-fedf-4834-bbab-d5fc3bc0dc94",
"symbol": "BTCUSDT",
"side": "Buy",
"size": "0.004",
"price": "",
"status": "7",
"executedSize": "0",
"dealTimeE3": "0",
"parentOrderId": "",
"createdTimeE3": "1773713015400",
"updatedTimeE3": "1773713015701",
"code": 60068,
"msg": "",
"category": "UTA_USDT",
"positionIdx": 0,
"leverageType": 0,
"tpPrice": "",
"slPrice": "",
"orderType": "UNKNOWN",
"orderPriceOffset": "0",
"positionValue": "",
"filledPositionValue": ""
}
],
"nextCursor": "eyJPZmZzZXQiOjIwMzM3MjU5MDU4MjU4NTM0NDAsIlBhZ2VTaXplIjoyLCJycGNDdXJzb3IiOiIifQ==",
"prevCursor": ""
},
"retExtInfo": {},
"time": 1774590281733
}