From e2e4ac0aa43cac2427d2726071f20bb4a2cf3ae1 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 10 Aug 2026 13:56:23 +0800
Subject: [PATCH] feat(gate): 添加加仓止损配置功能

---
 src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
index ba1de66..7a897dd 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
@@ -53,6 +53,18 @@
     private String unrealizedPnlPriceMode;
     /** 是否为生产环境 */
     private boolean isProduction;
+    /** 价格驱动开关:true=启用K线推送中的价格驱动逻辑,false=禁用。null=未设置(默认true) */
+    private Boolean priceDriveEnabled;
+    /** 策略运行轮数上限:达到盈利后重启计数,达到此值后不再重启。0=不限 */
+    private int rounds;
+    /** 止损次数统计方式:"single"=单向分别统计 / "dual"=双向统一统计,默认 "dual" */
+    private String stopLossCountMode;
+    /** 加仓间隔:每隔多少次止损触发一次加仓,默认 3 */
+    private int addPositionInterval;
+    /** 加仓数量:每次加仓追加的张数,默认 1 */
+    private int addPositionQuantity;
+    /** 单边最大仓位量:单向持仓张数上限,超出则按上限挂单,0=不限制 */
+    private int maxPositionPerSide;
 
     /**
      * 从 GateConfig 构建 DTO(不暴露 apiSecret)。
@@ -78,6 +90,12 @@
                 .unrealizedPnlPriceMode(config.getUnrealizedPnlPriceMode() != null
                         ? config.getUnrealizedPnlPriceMode().name() : "LAST_PRICE")
                 .isProduction(config.isProduction())
+                .priceDriveEnabled(config.isPriceDriveEnabled())
+                .rounds(config.getRounds())
+                .stopLossCountMode(config.getStopLossCountMode())
+                .addPositionInterval(config.getAddPositionInterval())
+                .addPositionQuantity(config.getAddPositionQuantity())
+                .maxPositionPerSide(config.getMaxPositionPerSide())
                 .build();
     }
 }

--
Gitblit v1.9.1