策略
訂閱策略推送,以獲取策略(TWAP / Iceberg / ChaseOrder)的即時數據更新。
Topic: strategy
響應參數
| 參數 | 類型 | 說明 |
|---|---|---|
| id | string | 消息id |
| topic | string | Topic名 |
| creationTime | number | 消息數據創建時間 |
| data | array | 物件 |
| > strategyId | string | 策略 ID |
| > strategyType | string | 策略類型。twap、chaseOrder、iceberg |
| > category | string | 產品類型。UTA_USDT、UTA_USDC、UTA_USDC_FUTURE、UTA_SPOT、UTA_INVERSE、UTA_INVERSE_FUTURE、UTA_USDT_FUTURE |
| > symbol | string | 交易對名稱 |
| > size | string | 總下單數量 |
| > side | string | Buy、Sell |
| > duration | integer | 計劃總執行時間(秒)。僅 TWAP |
| > status | integer | 策略狀態。2:執行中,3:已終止,4:已終止但訂單還未成交,5:已暫停,6:待觸發 |
| > terminateType | integer | 終止原因代碼。0:未知,1:使用者停止,2:正常完成,3:餘額不足。詳見 terminateType 枚舉 |
| > terminateRemark | string | 終止原因說明 |
| > executedDuration | integer | 實際已執行時間(秒) |
| > executedSize | string | 已成交數量 |
| > executedAvgPrice | string | 平均成交價格 |
| > executedStartTimeE3 | integer | 執行開始時間(毫秒) |
| > executedEndTimeE3 | integer | 執行結束時間(毫秒)。0 表示尚未結束 |
| > createdTimeE3 | integer | 策略創建時間(毫秒) |
| > updatedTimeE3 | integer | 策略最後更新時間(毫秒) |
| > isRandom | boolean | 是否啟用子訂單數量隨機化。僅 TWAP |
| > reduceOnly | boolean | 是否為只減倉訂單 |
| > limitPrice | string | 固定限價。訂單不會在此價格以外掛出 |
| > triggerCount | integer | 觸發嘗試次數 |
| > tradingCount | integer | 實際下單筆數 |
| > chaseDistance | string | 追蹤價格距離(絕對值)。Chase / Iceberg |
| > ChasePercentE4 | integer | 追蹤價格偏移(基點,1/10000)。例如 100 = 1%。Chase / Iceberg |
| > maxChasePrice | string | 最大追蹤價格保護。Chase / Iceberg |
| > chaseOrderPrice | string | 當前追蹤委託價格(實時)。僅 Chase |
| > strategyPrefer | string | 執行偏好。limit:固定價格,priceSpeedBalance:均衡,fastestExecution:最快成交,quickExecution:快速成交 |
| > interval | integer | 子訂單掛出間隔(秒)。僅 TWAP |
| > leverageType | integer | 槓桿類型。0:普通,1:借貸(僅現貨) |
| > postOnly | integer | 掛單模式。0:允許吃單,1:僅掛單。僅 Iceberg |
| > triggerPrice | string | 觸發價格。達到此價格後策略開始執行 |
| > isTriggered | boolean | 策略是否已被觸發 |
| > strategyTp | string | 策略止盈價格 |
| > strategySl | string | 策略止損價格 |
| > orderType | string | 訂單類型。1:市價單,2:限價單 |
| > orderPriceOffset | string | 限價單價格偏移百分比 |
| > positionValue | string | 策略總價值。按價值下單時返回,否則為空字串 |
| > filledPositionValue | string | 已成交持倉價值 |
訂閱示例
{
"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": ""
}
]
}