From 0017064558c515665645c3da68e073ec4a4c7ddf Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 28 May 2026 16:56:22 +0800
Subject: [PATCH] feat(gateApi): 添加保证金比例限制和网格队列容量配置选项

---
 src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java |    8 ++++----
 1 files changed, 4 insertions(+), 4 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 8543ed9..010042e 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java
@@ -245,10 +245,10 @@
      *
      * @return 已挂多仓条件单的 GridElement 列表
      */
-    public static List<GridElement> findAllLongOrders(BigDecimal currentPrice) {
+    public static List<GridElement> findAllShortOrders(BigDecimal currentPrice) {
         List<GridElement> result = new ArrayList<>();
         for (GridElement e : INDEX.values()) {
-            if (e.isHasLongOrder() && e.getGridPrice().compareTo(currentPrice) < 0) {
+            if (e.isHasShortOrder() && e.getGridPrice().compareTo(currentPrice) < 0 && e.getShortTakeProfitOrderId() == null) {
                 result.add(e);
             }
         }
@@ -261,10 +261,10 @@
      *
      * @return 已挂空仓条件单的 GridElement 列表
      */
-    public static List<GridElement> findAllShortOrders(BigDecimal currentPrice) {
+    public static List<GridElement> findAllLongOrders(BigDecimal currentPrice) {
         List<GridElement> result = new ArrayList<>();
         for (GridElement e : INDEX.values()) {
-            if (e.isHasShortOrder() && e.getGridPrice().compareTo(currentPrice) > 0) {
+            if (e.isHasLongOrder() && e.getGridPrice().compareTo(currentPrice) > 0 && e.getLongTakeProfitOrderId() == null) {
                 result.add(e);
             }
         }

--
Gitblit v1.9.1