跳至主要内容

策略

訂閱策略推送,以獲取策略(TWAP / Iceberg / ChaseOrder)的即時數據更新。

Topic: strategy

響應參數

參數類型說明
idstring消息id
topicstringTopic名
creationTimenumber消息數據創建時間
dataarray物件
> strategyIdstring策略 ID
> strategyTypestring策略類型。twapchaseOrdericeberg
> categorystring產品類型。UTA_USDTUTA_USDCUTA_USDC_FUTUREUTA_SPOTUTA_INVERSEUTA_INVERSE_FUTUREUTA_USDT_FUTURE
> symbolstring交易對名稱
> sizestring總下單數量
> sidestringBuySell
> durationinteger計劃總執行時間(秒)。僅 TWAP
> statusinteger策略狀態。2:執行中,3:已終止,4:已終止但訂單還未成交,5:已暫停,6:待觸發
> terminateTypeinteger終止原因代碼。0:未知,1:使用者停止,2:正常完成,3:餘額不足。詳見 terminateType 枚舉
> terminateRemarkstring終止原因說明
> executedDurationinteger實際已執行時間(秒)
> executedSizestring已成交數量
> executedAvgPricestring平均成交價格
> executedStartTimeE3integer執行開始時間(毫秒)
> executedEndTimeE3integer執行結束時間(毫秒)。0 表示尚未結束
> createdTimeE3integer策略創建時間(毫秒)
> updatedTimeE3integer策略最後更新時間(毫秒)
> isRandomboolean是否啟用子訂單數量隨機化。僅 TWAP
> reduceOnlyboolean是否為只減倉訂單
> limitPricestring固定限價。訂單不會在此價格以外掛出
> triggerCountinteger觸發嘗試次數
> tradingCountinteger實際下單筆數
> chaseDistancestring追蹤價格距離(絕對值)。Chase / Iceberg
> ChasePercentE4integer追蹤價格偏移(基點,1/10000)。例如 100 = 1%。Chase / Iceberg
> maxChasePricestring最大追蹤價格保護。Chase / Iceberg
> chaseOrderPricestring當前追蹤委託價格(實時)。僅 Chase
> strategyPreferstring執行偏好。limit:固定價格,priceSpeedBalance:均衡,fastestExecution:最快成交,quickExecution:快速成交
> intervalinteger子訂單掛出間隔(秒)。僅 TWAP
> leverageTypeinteger槓桿類型。0:普通,1:借貸(僅現貨)
> postOnlyinteger掛單模式。0:允許吃單,1:僅掛單。僅 Iceberg
> triggerPricestring觸發價格。達到此價格後策略開始執行
> isTriggeredboolean策略是否已被觸發
> strategyTpstring策略止盈價格
> strategySlstring策略止損價格
> orderTypestring訂單類型。1:市價單,2:限價單
> orderPriceOffsetstring限價單價格偏移百分比
> positionValuestring策略總價值。按價值下單時返回,否則為空字串
> filledPositionValuestring已成交持倉價值

訂閱示例

{
"op": "subscribe",
"args": [
"strategy"
]
}

推送示例

{
"id": "62f79ebea4794f767cad0bd937f7ad01",
"topic": "strategy",
"creationTime": 1776734985598,
"data": [
{
"strategyId": "cf7303ae-29c0-480a-8f3d-eaa9330054bc",
"strategyType": "iceberg",
"category": "UTA_USDT",
"symbol": "BTCUSDT",
"size": "0.36",
"side": "Buy",
"duration": 0,
"status": 3,
"terminateType": 2,
"terminateRemark": "RunningStop",
"executedDuration": 268,
"executedSize": "0.36",
"executedAvgPrice": "134301.53",
"executedStartTimeE3": 1776734716717,
"executedEndTimeE3": 1776734985592,
"createdTimeE3": 1776734716717,
"updatedTimeE3": 1776734985592,
"isRandom": false,
"reduceOnly": false,
"limitPrice": "",
"triggerCount": 0,
"tradingCount": 0,
"chaseDistance": "0",
"ChasePercentE4": 0,
"maxChasePrice": "198000",
"chaseOrderPrice": "135682.4",
"strategyPrefer": "quickExecution",
"interval": 30,
"leverageType": 0,
"postOnly": 0,
"triggerPrice": "",
"isTriggered": false,
"strategyTp": "",
"strategySl": "",
"orderType": "UNKNOWN",
"orderPriceOffset": "",
"positionValue": "",
"filledPositionValue": ""
}
]
}