From b7a2fa0ea40b15bd5b60d737cb96764884dcaaaa Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 28 May 2026 11:07:12 +0800
Subject: [PATCH] config(gateApi): 更新任意仓位变化,检查多空两边那些需要同时取消挂单
---
src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java b/src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java
index 90c2410..010042e 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java
@@ -248,7 +248,7 @@
public static List<GridElement> findAllShortOrders(BigDecimal currentPrice) {
List<GridElement> result = new ArrayList<>();
for (GridElement e : INDEX.values()) {
- if (e.isHasShortOrder() && e.getGridPrice().compareTo(currentPrice) < 0) {
+ if (e.isHasShortOrder() && e.getGridPrice().compareTo(currentPrice) < 0 && e.getShortTakeProfitOrderId() == null) {
result.add(e);
}
}
@@ -264,7 +264,7 @@
public static List<GridElement> findAllLongOrders(BigDecimal currentPrice) {
List<GridElement> result = new ArrayList<>();
for (GridElement e : INDEX.values()) {
- if (e.isHasLongOrder() && e.getGridPrice().compareTo(currentPrice) > 0) {
+ if (e.isHasLongOrder() && e.getGridPrice().compareTo(currentPrice) > 0 && e.getLongTakeProfitOrderId() == null) {
result.add(e);
}
}
--
Gitblit v1.9.1