From aa50bfb6c8d0ed688dd603f31e9066a0a9969296 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 10 Jun 2026 15:57:28 +0800
Subject: [PATCH] refactor(gateApi): 优化网格交易服务中的止损和仓位管理逻辑

---
 src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
index 8737e02..cf7e2a8 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -854,7 +854,6 @@
             if (BigDecimal.ZERO.compareTo( matched) == 0) {
                 return;
             }
-            log.info("[Gate] 多仓仓位归零 空仓队列触发, 匹配:{},当前价:{}", matched, currentPrice);
 
             GridElement matchedUpGridElement = GridElement.findByPrice(matched);
             if (matchedUpGridElement != null){
@@ -863,6 +862,7 @@
                     GridElement newEntryGrid = GridElement.findById(upId);
 
                     if (newEntryGrid != null) {
+                        log.info("[Gate] 多仓仓位归零 空仓队列触发, 匹配:{},当前价:{}", matched, currentPrice);
                         if (!newEntryGrid.isHasLongOrder()) {
                             BigDecimal triggerPrice = newEntryGrid.getGridPrice();
                             String size = config.getBaseQuantity();
@@ -902,8 +902,6 @@
                 return;
             }
 
-            log.info("[Gate] 空仓仓位归零 多仓队列触发, 匹配:{},当前价:{}", matched, currentPrice);
-
             GridElement matchedUpGridElement = GridElement.findByPrice(matched);
             if (matchedUpGridElement != null){
                 if(!matchedUpGridElement.isHasShortOrder()){
@@ -911,7 +909,7 @@
                     GridElement newEntryGrid = GridElement.findById(downId);
 
                     if (newEntryGrid != null) {
-
+                        log.info("[Gate] 空仓仓位归零 多仓队列触发, 匹配:{},当前价:{}", matched, currentPrice);
                         if (!newEntryGrid.isHasShortOrder()){
                             BigDecimal triggerPrice = newEntryGrid.getGridPrice();
                             String size = config.getBaseQuantity();

--
Gitblit v1.9.1