From 75836d48785da412552e67050e2332a74da2a435 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 08 Jan 2026 09:42:54 +0800
Subject: [PATCH] fix(okx): 修复交易参数配置和网格策略

---
 src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java |   10 ++++++----
 1 files changed, 6 insertions(+), 4 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 377bbba..0c855f3 100644
--- a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java
@@ -114,7 +114,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 服务器的连接。
@@ -296,6 +296,8 @@
      */
     private void triggerQuantOperations(String markPx) {
         try {
+
+//            markPx = String.valueOf(new BigDecimal(markPx).subtract(new BigDecimal("20")));
             // 1. 判断当前价格属于哪个网格
             WangGeListEnum gridByPriceNew = WangGeListEnum.getGridByPrice(new BigDecimal(markPx));
             if (gridByPriceNew == null) {
@@ -316,7 +318,7 @@
             for (OkxQuantWebSocketClient client : clientManager.getAllClients()) {
                 String accountName = client.getAccountName();
                 if (accountName != null) {
-                    log.info("当前价格{}属于网格: {}-{}({}-{})", markPx, gridByPriceNew.getName(),gridByPriceNew.getFang_xiang(), gridByPriceNew.getJiage_xiaxian(), gridByPriceNew.getJiage_shangxian());
+                    log.error("当前价格{}属于网格: {}-{}({}-{})", markPx, gridByPriceNew.getName(),gridByPriceNew.getFang_xiang(), gridByPriceNew.getJiage_xiaxian(), gridByPriceNew.getJiage_shangxian());
                     //处理历史网格信息
                     String fangXiang = gridByPriceNew.getFang_xiang();
                     String posSideOld = null;
@@ -339,7 +341,7 @@
                             String zhiSunDian = gridByPriceOld.getZhi_sun_dian();
                             if (CoinEnums.POSSIDE_SHORT.getCode().equals(posSideOld)) {
                                 boolean flag = new BigDecimal(markPx).compareTo(new BigDecimal(zhiSunDian)) > 0;
-                                log.info("{}历史网格方向{},当前价格大于止损点{}",gridByPriceOld.name(),posSideOld,flag);
+                                log.error("{}历史网格方向{},当前价格大于止损点{}",gridByPriceOld.name(),posSideOld,flag);
                                 if (flag){
                                     TradeRequestParam tradeRequestParam = caoZuoService.caoZuoZhiSunEvent(accountName, markPx, posSideOld);
                                     TradeOrderWs.orderEvent(client.getWebSocketClient(), tradeRequestParam);
@@ -348,7 +350,7 @@
                             }
                             if (CoinEnums.POSSIDE_LONG.getCode().equals(posSideOld)) {
                                 boolean flag = new BigDecimal(markPx).compareTo(new BigDecimal(zhiSunDian)) < 0;
-                                log.info("{}历史网格方向{},当前价格小于止损点{}",gridByPriceOld.name(),posSideOld,flag);
+                                log.error("{}历史网格方向{},当前价格小于止损点{}",gridByPriceOld.name(),posSideOld,flag);
                                 if (flag){
                                     TradeRequestParam tradeRequestParam = caoZuoService.caoZuoZhiSunEvent(accountName, markPx, posSideOld);
                                     TradeOrderWs.orderEvent(client.getWebSocketClient(), tradeRequestParam);

--
Gitblit v1.9.1