跳至主要内容

查詢策略列表

查詢策略列表。支援依策略 ID、交易對、狀態、產品類型及策略類型進行篩選。您也可以通過訂閱strategy流獲得實時更新

HTTP 請求

GET/v5/strategy/list

請求參數

參數是否必需類型說明
strategyIdfalsestring策略 ID(精確匹配)
symbolfalsestring交易對名稱,例如 BTCUSDT
statusfalsestring策略狀態。2:執行中,3:已終止,4:已終止但訂單還未成交, 5:已暫停,6:待觸發
categoryfalsestring產品類型。UTA_USDTUTA_USDCUTA_USDC_FUTUREUTA_SPOTUTA_INVERSEUTA_INVERSE_FUTUREUTA_USDT_FUTURE
strategyTypefalsestring策略類型。twapchaseOrdericeberg
beginTimeE0falseint64起始時間(Unix 時間戳,秒)
endTimeE0falseint64結束時間(Unix 時間戳,秒)
pageSizefalseinteger每頁資料筆數。默認:20,最大:50
cursorfalsestring分頁游標,從上一次響應中返回

響應參數

參數類型說明
listarray物件
> strategyIdstring策略 ID(UUID 格式)
> categorystring產品類型
> symbolstring交易對名稱
> sidestringBuySell
> sizestring總下單數量
> strategyTypestring策略類型。twapchaseOrdericeberg
> statusinteger策略狀態。2:執行中,3:已終止,4:已終止但訂單還未成交,5:已暫停,6:待觸發
> executedSizestring已成交數量
> executedAvgPricestring平均成交價格
> executedStartTimeE3int64執行開始時間(毫秒)
> executedEndTimeE3int64執行結束時間(毫秒)。0 表示尚未結束
> createdTimeE3int64策略創建時間(毫秒)
> updatedTimeE3int64策略最後更新時間(毫秒)
> reduceOnlyboolean是否為只減倉訂單
> triggerPricestring觸發價格
> isTriggeredboolean策略是否已被觸發
> leverageTypeinteger槓桿類型。0:普通,1:借貸
> terminateTypeinteger終止原因代碼。0:未知,1:使用者停止,2:正常完成,3:餘額不足,4:持倉模式變更,5:UID 被封禁,6:觸發強平,7:只減倉但無持倉,8:升級至 UTA,9:OI 超限,10:用戶交易被禁,11:超過風險限額,12:交易對交割停止,13:交易對下架,14:連續下單失敗,15:缺少模板參數,16:信號延遲,17:交易對不匹配,18:超出最大追蹤價格,19:子訂單數量超限,20:訂單已取消,21:超出最大風險限額,22:風險限額最大槓桿超限,23:幣種非抵押品,24:達到限價,25:只減倉狀態下有待處理的 UTA 升級,26:用戶處於冷靜期
> terminateRemarkstring終止原因說明
> triggerCountinteger觸發嘗試次數
> tradingCountinteger實際下單筆數
> realizedPnlstring已實現盈虧(僅合約)
> strategyNamestring策略自訂名稱
> strategyPreferstring執行偏好。limitpriceSpeedBalancefastestExecutionquickExecution
> durationinteger計劃總執行時間(秒)。僅 TWAP
> executedDurationinteger實際已執行時間(秒)。僅 TWAP
> isRandomboolean是否啟用子訂單數量隨機化。僅 TWAP
> intervalinteger子訂單掛出間隔(秒)。僅 TWAP
> limitPricestring固定限價。訂單不會在此價格以外掛出
> chasePercentE4int64追蹤價格偏移(基點,1/10000)。Chase / Iceberg
> chaseDistancestring追蹤價格距離(絕對值)。Chase / Iceberg
> maxChasePricestring最大追蹤價格保護。Chase / Iceberg
> chaseOrderPricestring當前追蹤委託價格(實時)。僅 Chase
> chasePricestring追蹤委託的參考價格方向,例如 Bid1Ask1Chase / Iceberg
> postOnlyinteger掛單模式。0:允許吃單,1:僅掛單。僅 Iceberg
> isRebalanceboolean是否啟用再平衡
> orderTypeinteger訂單類型。1:市價單,2:限價單
> orderPriceOffsetstring限價單價格偏移百分比。僅 TWAP
> strategySlstring策略止損價格
> strategyTpstring策略止盈價格
> arbitrageOrdersarray關聯套利訂單列表
> positionValuestring總持倉價值
> filledPositionValuestring已成交持倉價值
nextCursorstring下一頁游標。空字串表示無更多資料
prevCursorstring上一頁游標

請求示例

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

響應示例

{
"retCode": 0,
"retMsg": "success",
"result": {
"list": [
{
"strategyId": "119b6211-2611-461b-be5e-5ac557099e82",
"category": "UTA_USDT",
"symbol": "BTCUSDT",
"side": "Buy",
"size": "0.05",
"duration": 1560,
"status": 3,
"executedDuration": 1608,
"executedSize": "0.046",
"executedAvgPrice": "76695.48",
"executedStartTimeE3": "1773711467045",
"executedEndTimeE3": "1773713075628",
"createdTimeE3": "1773711467045",
"updatedTimeE3": "1773713075628",
"isRandom": false,
"limitPrice": "",
"reduceOnly": false,
"terminateType": 2,
"terminateRemark": "RunningStop",
"strategyName": "",
"triggerCount": "26",
"tradingCount": "0",
"realizedPnl": "0",
"strategyType": "twap",
"chasePrice": "Bid1",
"chasePercentE4": "0",
"chaseDistance": "0",
"maxChasePrice": "",
"chaseOrderPrice": "",
"arbitrageOrders": [],
"strategyPrefer": "quickExecution",
"isRebalance": false,
"interval": 60,
"leverageType": 0,
"postOnly": 0,
"triggerPrice": "0",
"isTriggered": false,
"strategyTp": "",
"strategySl": "",
"orderType": "UNKNOWN",
"orderPriceOffset": "",
"positionValue": "",
"filledPositionValue": ""
}
],
"nextCursor": "",
"prevCursor": ""
},
"retExtInfo": {},
"time": 1774583153599
}