From 1b5c1005f3b46e60cbf08d5ae7924b23765084eb Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 26 May 2026 10:08:02 +0800
Subject: [PATCH] fix(gateApi): 修复网格交易中多空仓位订单取消逻辑错误

---
 src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 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 04a4108..4e0776f 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -426,14 +426,14 @@
                     tryGenerateQueues();
                 }else {
                     longPositionSize = size;
-                    //取消多仓位线以上的开空仓挂单
+                    //取消多仓位线以上的开多仓挂单
                     List<GridElement> allShortOrders = GridElement.findAllShortOrders(longEntryPrice);
                     if (CollUtil.isNotEmpty(allShortOrders)){
                         for (GridElement e : allShortOrders) {
                             executor.cancelConditionalOrder(
-                                    e.getShortOrderId(),
+                                    e.getLongOrderId(),
                                     orderId -> {
-                                        shortEntryTraderIdParam(
+                                        longEntryTraderIdParam(
                                                 e,
                                                 null,
                                                 false
@@ -441,11 +441,11 @@
                                     }
                             );
 
-                            if (e.getShortTakeProfitOrderId() != null){
+                            if (e.getLongTakeProfitOrderId() != null){
                                 executor.cancelConditionalOrder(
-                                        e.getShortTakeProfitOrderId(),
+                                        e.getLongTakeProfitOrderId(),
                                         orderId -> {
-                                            shortTakeProfitTraderIdParam(
+                                            longTakeProfitTraderIdParam(
                                                     e,
                                                     null,
                                                     false
@@ -472,25 +472,25 @@
                     tryGenerateQueues();
                 }else {
                     shortPositionSize = size.abs();
-                    //取消空仓仓位线以下的开多仓挂单
+                    //取消空仓仓位线以下的开空仓挂单
                     List<GridElement> allLongOrders = GridElement.findAllLongOrders(shortEntryPrice);
                     if (CollUtil.isNotEmpty(allLongOrders)){
                         for (GridElement e : allLongOrders) {
                             executor.cancelConditionalOrder(
-                                    e.getLongOrderId(),
+                                    e.getShortOrderId(),
                                     orderId -> {
-                                        longEntryTraderIdParam(
+                                        shortEntryTraderIdParam(
                                                 e,
                                                 null,
                                                 false
                                         );
                                     }
                             );
-                            if (e.getLongTakeProfitOrderId() != null){
+                            if (e.getShortTakeProfitOrderId() != null){
                                 executor.cancelConditionalOrder(
-                                        e.getLongTakeProfitOrderId(),
+                                        e.getShortTakeProfitOrderId(),
                                         orderId -> {
-                                            longTakeProfitTraderIdParam(
+                                            shortTakeProfitTraderIdParam(
                                                     e,
                                                     null,
                                                     false

--
Gitblit v1.9.1