From 0286ecaa7184a85baa4dd2840f371b57047a03fb Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 10 Jun 2026 16:04:11 +0800
Subject: [PATCH] fix(gateApi): 修复网格交易策略状态管理问题
---
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java | 8 ++++----
1 files changed, 4 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..b189632 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -480,6 +480,8 @@
e.printStackTrace();
}
closeExistingPositions();
+
+ state = StrategyState.STOPPED;
// 提交到 executor 末尾:单线程FIFO保证前面所有平仓/取消任务完成后才重置
executor.submitTask(() -> {
try { Thread.sleep(3000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); }
@@ -854,7 +856,6 @@
if (BigDecimal.ZERO.compareTo( matched) == 0) {
return;
}
- log.info("[Gate] 多仓仓位归零 空仓队列触发, 匹配:{},当前价:{}", matched, currentPrice);
GridElement matchedUpGridElement = GridElement.findByPrice(matched);
if (matchedUpGridElement != null){
@@ -863,6 +864,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 +904,6 @@
return;
}
- log.info("[Gate] 空仓仓位归零 多仓队列触发, 匹配:{},当前价:{}", matched, currentPrice);
-
GridElement matchedUpGridElement = GridElement.findByPrice(matched);
if (matchedUpGridElement != null){
if(!matchedUpGridElement.isHasShortOrder()){
@@ -911,7 +911,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