From e5931c6e148b04083d0a23b90dcac7de850d31b9 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 21 Sep 2026 10:01:09 +0800
Subject: [PATCH] fix(gateApi): 修复止损逻辑只针对初始开仓仓位

---
 src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java
index 4c20b2c..fa96fd5 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java
@@ -131,11 +131,11 @@
     /** 止盈挂单模式:off=关闭 / concentrated=集中止盈 / dispersed=分散止盈,默认 off */
     private final String placeExcessTakeProfit;
     /** 自定义止损开关:true=启用自定义止损触发价(多空各挂一单),false=使用默认阶梯止损。默认 false */
-    private final boolean customStopLossEnabled;
+    private final boolean dualStopLossEnabled;
     /** 多仓自定义止损触发价(价格跌至该值触发平多),null/0=未设置 */
-    private final BigDecimal longCustomStopLossPrice;
+    private final BigDecimal longStopLossPrice;
     /** 空仓自定义止损触发价(价格涨至该值触发平空),null/0=未设置 */
-    private final BigDecimal shortCustomStopLossPrice;
+    private final BigDecimal shortStopLossPrice;
     /** 网格绝对步长(shortBaseEntryPrice × gridRate),运行时由队列生成逻辑设置 */
     private BigDecimal step;
     /** 网格元素列表,由队列初始化时同步填充,包含完整的多空仓挂单状态 */
@@ -177,9 +177,9 @@
         this.maxPositionPerSide = builder.maxPositionPerSide;
         this.addPositionStartThreshold = builder.addPositionStartThreshold;
         this.placeExcessTakeProfit = builder.placeExcessTakeProfit;
-        this.customStopLossEnabled = builder.customStopLossEnabled;
-        this.longCustomStopLossPrice = builder.longCustomStopLossPrice;
-        this.shortCustomStopLossPrice = builder.shortCustomStopLossPrice;
+        this.dualStopLossEnabled = builder.dualStopLossEnabled;
+        this.longStopLossPrice = builder.longStopLossPrice;
+        this.shortStopLossPrice = builder.shortStopLossPrice;
     }
 
     // ==================== REST/WS 地址 ====================
@@ -288,11 +288,11 @@
     /** @return 止盈挂单模式:off=关闭 / concentrated=集中止盈 / dispersed=分散止盈 */
     public String getPlaceExcessTakeProfit() { return placeExcessTakeProfit; }
     /** @return 自定义止损开关:true=启用自定义止损触发价,false=使用默认阶梯止损 */
-    public boolean isCustomStopLossEnabled() { return customStopLossEnabled; }
+    public boolean isDualStopLossEnabled() { return dualStopLossEnabled; }
     /** @return 多仓自定义止损触发价,null/0=未设置 */
-    public BigDecimal getLongCustomStopLossPrice() { return longCustomStopLossPrice; }
+    public BigDecimal getLongStopLossPrice() { return longStopLossPrice; }
     /** @return 空仓自定义止损触发价,null/0=未设置 */
-    public BigDecimal getShortCustomStopLossPrice() { return shortCustomStopLossPrice; }
+    public BigDecimal getShortStopLossPrice() { return shortStopLossPrice; }
 
     // ==================== 运行时参数 ====================
 
@@ -406,11 +406,11 @@
         /** 止盈挂单模式:off=关闭 / concentrated=集中止盈 / dispersed=分散止盈,默认 off */
         private String placeExcessTakeProfit = EXCESS_TP_OFF;
         /** 自定义止损开关:true=启用自定义止损触发价,false=使用默认阶梯止损。默认 false */
-        private boolean customStopLossEnabled = false;
+        private boolean dualStopLossEnabled = false;
         /** 多仓自定义止损触发价,null=未设置 */
-        private BigDecimal longCustomStopLossPrice;
+        private BigDecimal longStopLossPrice;
         /** 空仓自定义止损触发价,null=未设置 */
-        private BigDecimal shortCustomStopLossPrice;
+        private BigDecimal shortStopLossPrice;
 
         /** 设置 API Key */
         public Builder apiKey(String apiKey) { this.apiKey = apiKey; return this; }
@@ -475,11 +475,11 @@
         /** 设置止盈挂单模式:off / concentrated / dispersed */
         public Builder placeExcessTakeProfit(String placeExcessTakeProfit) { this.placeExcessTakeProfit = placeExcessTakeProfit; return this; }
         /** 设置自定义止损开关:true=启用自定义止损触发价 */
-        public Builder customStopLossEnabled(boolean customStopLossEnabled) { this.customStopLossEnabled = customStopLossEnabled; return this; }
+        public Builder dualStopLossEnabled(boolean dualStopLossEnabled) { this.dualStopLossEnabled = dualStopLossEnabled; return this; }
         /** 设置多仓自定义止损触发价 */
-        public Builder longCustomStopLossPrice(BigDecimal longCustomStopLossPrice) { this.longCustomStopLossPrice = longCustomStopLossPrice; return this; }
+        public Builder longStopLossPrice(BigDecimal longStopLossPrice) { this.longStopLossPrice = longStopLossPrice; return this; }
         /** 设置空仓自定义止损触发价 */
-        public Builder shortCustomStopLossPrice(BigDecimal shortCustomStopLossPrice) { this.shortCustomStopLossPrice = shortCustomStopLossPrice; return this; }
+        public Builder shortStopLossPrice(BigDecimal shortStopLossPrice) { this.shortStopLossPrice = shortStopLossPrice; return this; }
 
         public GateConfig build() {
             return new GateConfig(this);

--
Gitblit v1.9.1