From e2dd80eec7df85a422d11338ca9dfdb869782a79 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 24 Jun 2026 21:27:50 +0800
Subject: [PATCH] fix(grid): 修复网格元素索引并发访问问题
---
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java | 8 ++++++++
1 files changed, 8 insertions(+), 0 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 7f6533d..1ea2c85 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -1338,6 +1338,14 @@
if (span <= 0) {
return;
}
+
+ // 检查是否还有剩余止盈单,只有多空止盈全部清空才继续
+ if (GridElement.getLongTakeProfitCount() > 0 || GridElement.getShortTakeProfitCount() > 0) {
+ log.info("[Gate] 尚有未触发止盈单, 暂不检查跨度重启 longTpCount:{}, shortTpCount:{}",
+ GridElement.getLongTakeProfitCount(), GridElement.getShortTakeProfitCount());
+ return;
+ }
+
BigDecimal step = config.getStep();
if (step == null || step.compareTo(BigDecimal.ZERO) == 0) {
return;
--
Gitblit v1.9.1