From 53dba56501e03dcf761fc9ac7bedbfdc922eefec Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 18 May 2026 17:02:17 +0800
Subject: [PATCH] 第二个版本

---
 src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java |   12 ++++++------
 1 files changed, 6 insertions(+), 6 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 6ffb218..9c720ec 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -524,12 +524,12 @@
         GridElement byShortTakeProfitOrderId = GridElement.findByShortTakeProfitOrderId(orderId);
         if (byShortTakeProfitOrderId != null){
             shortTakeProfitTraderIdParam(
-                    byLongTakeProfitOrderId,
+                    byShortTakeProfitOrderId,
                     null,
                     false
             );
             shortEntryTraderIdParam(
-                    byLongTakeProfitOrderId,
+                    byShortTakeProfitOrderId,
                     null,
                     false
             );
@@ -838,8 +838,8 @@
             elements.add(GridElement.builder()
                     .id(0)
                     .gridPrice(price)
-                    .upId(shortSize > 0 ? -1 : null)
-                    .downId(longSize > 0 ? 1 : null)
+                    .upId(shortSize > 0 ? 1 : null)
+                    .downId(longSize > 0 ? -1 : null)
                     .longTraderParam(longParam)
                     .shortTraderParam(shortParam)
                     .build());
@@ -848,8 +848,8 @@
         // 多仓队列:id 从 1 自增, longPriceQueue[i] → id=i+1
         for (int i = 0; i < longSize; i++) {
             int id = i + 1;
-            Integer upId = (i == 0) ? 0 : id - 1;
-            Integer downId = (i == longSize - 1) ? null : id + 1;
+            Integer downId = (i == 0) ? 0 : id - 1;
+            Integer upId = (i == longSize - 1) ? null : id + 1;
             BigDecimal price = longPriceQueue.get(i);
             TraderParam longParam = TraderParam.builder()
                     .direction(TraderParam.Direction.LONG)

--
Gitblit v1.9.1