From 3ebd59a88bc0bdcf91dff94ad2ba25e1f4fe682f Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 19 Nov 2026 17:38:35 +0800
Subject: [PATCH] feat(config): 添加原始仓位减仓递减步长配置

---
 src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 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 9afad22..dfb20d7 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java
@@ -123,6 +123,8 @@
     private final int addPositionStartThreshold;
     /** 超额止盈开关:true=挂单成交后将超出基础仓位的部分挂止盈单(挂在对手第一止损位),默认 false */
     private final boolean placeExcessTakeProfit;
+    /** 原始仓位减仓递减步长:0=关闭,>0=每次止损后追单量递减的步长,默认 0 */
+    private final int originalPositionReduce;
     /** 网格绝对步长(shortBaseEntryPrice × gridRate),运行时由队列生成逻辑设置 */
     private BigDecimal step;
     /** 网格元素列表,由队列初始化时同步填充,包含完整的多空仓挂单状态 */
@@ -164,6 +166,7 @@
         this.maxPositionPerSide = builder.maxPositionPerSide;
         this.addPositionStartThreshold = builder.addPositionStartThreshold;
         this.placeExcessTakeProfit = builder.placeExcessTakeProfit;
+        this.originalPositionReduce = builder.originalPositionReduce;
     }
 
     // ==================== REST/WS 地址 ====================
@@ -271,6 +274,8 @@
     public int getAddPositionStartThreshold() { return addPositionStartThreshold; }
     /** @return 超额止盈开关:true=挂单成交后将超出基础仓位的部分挂止盈单 */
     public boolean isPlaceExcessTakeProfit() { return placeExcessTakeProfit; }
+    /** @return 原始仓位减仓递减步长:0=关闭,>0=每次止损后追单量递减的步长 */
+    public int getOriginalPositionReduce() { return originalPositionReduce; }
 
     // ==================== 运行时参数 ====================
 
@@ -383,6 +388,8 @@
         private int addPositionStartThreshold = 1;
         /** 超额止盈开关:true=挂单成交后将超出基础仓位的部分挂止盈单,默认 false */
         private boolean placeExcessTakeProfit = false;
+        /** 原始仓位减仓递减步长:0=关闭,>0=每次止损后追单量递减的步长,默认 0 */
+        private int originalPositionReduce = 0;
 
         /** 设置 API Key */
         public Builder apiKey(String apiKey) { this.apiKey = apiKey; return this; }
@@ -446,6 +453,8 @@
         public Builder addPositionStartThreshold(int addPositionStartThreshold) { this.addPositionStartThreshold = addPositionStartThreshold; return this; }
         /** 设置超额止盈开关:true=挂单成交后将超出基础仓位的部分挂止盈单 */
         public Builder placeExcessTakeProfit(boolean placeExcessTakeProfit) { this.placeExcessTakeProfit = placeExcessTakeProfit; return this; }
+        /** 设置原始仓位减仓递减步长:0=关闭,>0=每次止损后追单量递减的步长 */
+        public Builder originalPositionReduce(int originalPositionReduce) { this.originalPositionReduce = originalPositionReduce; return this; }
 
         public GateConfig build() {
             return new GateConfig(this);

--
Gitblit v1.9.1