查詢實時委託單
實時查詢未成交或部分成交的訂單信息. 若需要查詢更久的訂單紀錄,請使用查詢歷史訂單接口.
提示
- 當
orderId和orderLinkId不傳時,最多返回500條紀錄 - 返回的結果將以
createdTime從新到舊排序.
HTTP 請求
GET /unified/v3/private/order/unfilled-orders
請求參數
| 參數 | 是否必需 | 類型 | 說明 |
|---|---|---|---|
| category | true | string | 產品類型. linear, option |
| symbol | false | string | 合約名稱 |
| baseCoin | false | string | 交易幣種. 若category=option,不傳時,默認返回BTC相關數據 |
| orderId | false | string | 訂單id |
| orderLinkId | false | string | 用戶自定義訂單Id |
| orderFilter | false | string | Order: 普通單, StopOrder: 條件單 |
| direction | false | string | 翻頁方向. prev: 向前翻頁, next: 向後翻頁. 默認: next |
| limit | false | integer | 每頁數量限制. [1, 50]. 默認: 20 |
| cursor | false | string | 游標,用於翻頁 |
響應參數
| 參數 | 類型 | 說明 |
|---|---|---|
| category | string | 產品類型 |
| nextPageCursor | string | 游標,用於翻頁 |
| list | array | Object |
| > orderId | string | 訂單Id |
| > orderLinkId | string | 用戶自定義ID |
| > blockTradeId | string | Paradigm大宗交易ID |
| > symbol | string | 合約名稱 |
| > iv | string | 隱含波動率. linear沒有該字段 |
| > price | string | 訂單價格 |
| > qty | string | 訂單數量 |
| > side | string | 方向. Buy,Sell |
| > orderStatus | string | 訂單狀態 |
| > orderType | string | 訂單類型. Market,Limit |
| > stopOrderType | string | 條件單類型. option沒有該字段 |
| > cumExecValue | string | 訂單累計成交價值 |
| > cumExecFee | string | 訂單累計成交的手續費 |
| > cumExecQty | string | 訂單累計成交數量 |
| > tpTriggerBy | string | 觸發止盈的價格類型. option沒有該字段 |
| > slTriggerBy | string | 觸發止損的價格類型. option沒有該字段 |
| > timeInForce | string | 執行策略 |
| > basePrice | string | 當前市價,用於條件單 |
| > triggerBy | string | 觸發價格的觸發類型. option沒有該字段 |
| > triggerPrice | string | 觸發價格. 若stopOrderType=TrailingStop, 則這是激活價格. 否則, 它是觸發價格. option沒有該字段 |
| > leavesQty | string | 訂單剩餘未成交的數量 |
| > reduceOnly | boolean | 只減倉. true表明這是只減倉單 |
| > closeOnTrigger | boolean | 觸發後平倉委託. option沒有該字段 |
| > takeProfit | string | 止盈價格. option沒有該字段 |
| > stopLoss | string | 止損價格. option沒有該字段 |
| > orderIM | string | 訂單初始保證金. 組合保證金模式下,該字段返回空字符串 |
| > createdTime | number | 創建訂單的時間戳 (毫秒) |
| > updatedTime | number | 訂單更新的時間戳 (毫秒) |
請求示例
GET /unified/v3/private/order/unfilled-orders?category=option&baseCoin=BTC HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1673079658059
X-BAPI-RECV-WINDOW: 5000
響應示例
- linear
- option
{
"retCode": 0,
"retMsg": "OK",
"result": {
"nextPageCursor": "d00b5b7b-4e05-4a12-a81c-8afb6ddf76bc%3A1673079539417%2Cd00b5b7b-4e05-4a12-a81c-8afb6ddf76bc%3A1673079539417",
"category": "linear",
"list": [
{
"symbol": "MATICUSDT",
"orderType": "Limit",
"orderLinkId": "",
"orderId": "d00b5b7b-4e05-4a12-a81c-8afb6ddf76bc",
"stopOrderType": "UNKNOWN",
"orderStatus": "New",
"takeProfit": "",
"cumExecValue": "0.00000000",
"blockTradeId": "",
"price": "1.00000000",
"createdTime": 1673079539417,
"tpTriggerBy": "UNKNOWN",
"timeInForce": "PostOnly",
"basePrice": "",
"updatedTime": 1673079539426,
"side": "Sell",
"triggerPrice": "",
"cumExecFee": "0.00000000",
"slTriggerBy": "UNKNOWN",
"leavesQty": "500.0000",
"closeOnTrigger": true,
"cumExecQty": "0.00000000",
"reduceOnly": true,
"qty": "500.0000",
"stopLoss": "",
"triggerBy": "UNKNOWN",
"orderIM": ""
}
]
},
"retExtInfo": {},
"time": 1673079551691
}
{
"retCode": 0,
"retMsg": "OK",
"result": {
"nextPageCursor": "b8e9fd9c-c710-4c78-86a3-ab923e19c380%3A1673079645947%2Cb8e9fd9c-c710-4c78-86a3-ab923e19c380%3A1673079645947",
"category": "option",
"list": [
{
"symbol": "BTC-27JAN23-12000-P",
"orderType": "Limit",
"updatedTime": 1673079645958,
"side": "Sell",
"orderLinkId": "",
"cumExecFee": "0.00000000",
"orderId": "b8e9fd9c-c710-4c78-86a3-ab923e19c380",
"leavesQty": "0.1000",
"orderStatus": "New",
"iv": "0.78295834",
"cumExecValue": "0.00000000",
"blockTradeId": "",
"cumExecQty": "0.00000000",
"reduceOnly": false,
"price": "30.00000000",
"qty": "0.1000",
"createdTime": 1673079645947,
"timeInForce": "GoodTillCancel",
"orderIM": "169.75360098",
"basePrice": ""
}
]
},
"retExtInfo": {},
"time": 1673079658761
}