Administrator
4 days ago 5982ab32ef6f4af48426f35e57ccd829fea7bfbf
src/main/java/com/xcong/excoin/modules/okxApi/OkxWebSocketClientManager.java
@@ -1,7 +1,7 @@
package com.xcong.excoin.modules.okxApi;
import com.xcong.excoin.modules.okxApi.wsHandler.handler.MarkPriceOkxChannelHandler;
import com.xcong.excoin.modules.okxApi.wsHandler.handler.OrderAlgoOkxChannelHandler;
import com.xcong.excoin.modules.okxApi.wsHandler.handler.OrdersOkxChannelHandler;
import com.xcong.excoin.modules.okxApi.wsHandler.handler.PositionsOkxChannelHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@@ -25,7 +25,7 @@
 * <ol>
 *   <li>MarkPriceOkxChannelHandler — 公开频道,标记价格 → onKline() + setMarkPrice()</li>
 *   <li>PositionsOkxChannelHandler — 私有频道,仓位 → onPositionUpdate()</li>
 *   <li>OrderAlgoOkxChannelHandler — 私有频道,条件单状态 → onAutoOrder()</li>
 *   <li>OrdersOkxChannelHandler — 私有频道,订单成交(含algoId) → onAutoOrder()</li>
 * </ol>
 *
 * <h3>销毁顺序({@code @PreDestroy})</h3>
@@ -58,11 +58,11 @@
                    .leverage("100")
                    .marginMode("cross")
                    .positionMode("long_short_mode")
                    .gridRate(new BigDecimal("0.003"))
                    .gridRate(new BigDecimal("0.0025"))
                    .expectedProfit(new BigDecimal("25"))
                    .maxLoss(new BigDecimal("15"))
                    .baseQuantity("15")
                    .quantity("15")
                    .baseQuantity("1")
                    .quantity("1")
                    .restartGridSpan(6)
                    .maxPositionSize(2)
                    .priceScale(2)
@@ -85,8 +85,8 @@
            // 私有频道:仓位
            wsClient.addPrivateHandler(new PositionsOkxChannelHandler(
                    config, gridTradeService));
            // 私有频道:条件单
            wsClient.addPrivateHandler(new OrderAlgoOkxChannelHandler(
            // 私有频道:条件单(orders 频道含 algoId,可追溯到源条件单)
            wsClient.addPrivateHandler(new OrdersOkxChannelHandler(
                    config, gridTradeService));
            gridTradeService.setWsClient(wsClient);