From bede2aecbc1f3ce5d607081eec64d4cb2ab31b03 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 10 Dec 2025 16:29:44 +0800
Subject: [PATCH] feat(okxWs): 添加账户和持仓WebSocket更新间隔配置

---
 src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java b/src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java
index f7ffced..38e0cd3 100644
--- a/src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java
@@ -24,18 +24,23 @@
     public static void orderEvent(WebSocketClient webSocketClient, RedisUtils redisUtils, String side) {
 
         log.info("开始执行TradeOrderWs......");
+        if (StrUtil.isBlank( side)){
+            log.warn("止损了,下次再战...");
+            return;
+        }
 
         String buyCnt = null;
         String ctval = getRedisValue(redisUtils, InstrumentsWs.INSTRUMENTSWS_CHANNEL, ":ctVal");
         String buyCntNormal = getRedisValue(redisUtils, PositionsWs.POSITIONSWS_CHANNEL, ":buyCnt");
         String pos = getRedisValue(redisUtils, PositionsWs.POSITIONSWS_CHANNEL, ":pos");
         if (OrderParamEnums.ORDERING.getValue().equals(side)) {
+            log.warn("正在下单中,等待下单结束...");
             return;
         } else if (OrderParamEnums.HOLDING.getValue().equals(side)) {
             return;
         } else if (OrderParamEnums.INIT.getValue().equals(side)) {
             side = OrderParamEnums.BUY.getValue();
-            if (StrUtil.isNotBlank(buyCntNormal) && BigDecimal.ZERO.compareTo(new BigDecimal(buyCntNormal)) > 0) {
+            if (StrUtil.isNotBlank(buyCntNormal) && new BigDecimal(buyCntNormal).compareTo(BigDecimal.ZERO) > 0) {
                 buyCnt = buyCntNormal;
             }else{
                 buyCnt = ctval;
@@ -46,7 +51,7 @@
             buyCnt = pos;
         } else if (OrderParamEnums.BUY.getValue().equals(side)){
             side = OrderParamEnums.BUY.getValue();
-            if (StrUtil.isNotBlank(buyCntNormal) && BigDecimal.ZERO.compareTo(new BigDecimal(buyCntNormal)) > 0) {
+            if (StrUtil.isNotBlank(buyCntNormal) && new BigDecimal(buyCntNormal).compareTo(BigDecimal.ZERO) > 0) {
                 buyCnt = buyCntNormal;
             }else{
                 buyCnt = ctval;

--
Gitblit v1.9.1