From de704d4f87680600aa03782bcd905487e3e81e5f Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 06 Jan 2026 14:20:50 +0800
Subject: [PATCH] refactor(okxNewPrice): 优化MACD策略日志输出和交易逻辑

---
 src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java
index 6497857..782467e 100644
--- a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java
@@ -110,7 +110,7 @@
 
     private static final String WS_URL_MONIPAN = "wss://wspap.okx.com:8443/ws/v5/public";
     private static final String WS_URL_SHIPAN = "wss://ws.okx.com:8443/ws/v5/public";
-    private static final boolean isAccountType = false;
+    private static final boolean isAccountType = true;
 
     /**
      * 建立与 OKX WebSocket 服务器的连接。
@@ -319,7 +319,7 @@
                      *      如果不一致则需要处理
                      */
                     String fangXiang = gridByPriceNew.getFang_xiang();
-                    String fangXiangOld = CoinEnums.POSSIDE_LONG.equals(fangXiang) ? CoinEnums.POSSIDE_SHORT.getCode() : CoinEnums.POSSIDE_LONG.getCode();
+                    String fangXiangOld = CoinEnums.POSSIDE_LONG.getCode().equals(fangXiang) ? CoinEnums.POSSIDE_SHORT.getCode() : CoinEnums.POSSIDE_LONG.getCode();
                     log.info("历史网格方向为:{}", fangXiangOld);
                     if (!fangXiang.equals(fangXiangOld)){
                         TradeRequestParam tradeRequestParamOld = caoZuoService.caoZuoZhiSunEvent(accountName, markPx, fangXiangOld);
@@ -430,7 +430,7 @@
      */
     private void reconnectWithBackoff() throws InterruptedException {
         int attempt = 0;
-        int maxAttempts = 5;
+        int maxAttempts = 3;
         long delayMs = 5000;
 
         while (attempt < maxAttempts) {

--
Gitblit v1.9.1