From be5d6edd42e8083c93af4ffbb77486ccc8b3cd4b Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 24 Nov 2026 11:28:13 +0800
Subject: [PATCH] fix(gateApi): 忽略Gate配置反序列化未知属性
---
src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 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 5cd93fd..b89d608 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
@@ -69,6 +69,8 @@
private int maxPositionPerSide;
/** 加仓启动阈值:前N次止损不触发加仓,默认 1 */
private int addPositionStartThreshold;
+ /** 加仓停止阈值:启动加仓后按「加仓执行次数」计数,超过该值后加仓张数恢复为基础张数;0=不限制 */
+ private int addPositionStopThreshold;
/** 止盈挂单模式:off=关闭 / concentrated=集中止盈 / dispersed=分散止盈,默认 off */
private String placeExcessTakeProfit;
/** 自定义止损开关:true=启用自定义止损触发价,false=使用默认阶梯止损。null=未设置(默认false) */
@@ -81,10 +83,12 @@
private Boolean tpTriggerOppositeAddEnabled;
/** 对向加仓挂单数量:止盈成交后在对向挂出的开仓张数,0=不启用 */
private Integer tpTriggerOppositeAddQuantity;
- /** 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数,支持小数,0=不启用 */
- private BigDecimal baseTakeProfitPerGrid;
- /** 止盈网格数量:基础仓位止盈挂单的网格数量,0=不启用 */
- private Integer baseTakeProfitGridCount;
+ /** 仓位止盈补仓开关:true=止盈触发时在对侧止损位挂同方向同张数开仓单,false=保持现有逻辑。null=未设置(默认false) */
+ private Boolean tpPositionReplenishEnabled;
+ /** 原始仓位止盈总数量:平均分配到对手盘止损位前的所有网格,余数挂最后一格,每格至少1张,0=不启用 */
+ private Integer baseTakeProfitTotalQty;
+ /** 原始仓位减仓递减步长:0=关闭,>0=每次止损后追单量递减的步长,默认 0 */
+ private Integer originalPositionReduce;
/**
* 从 GateConfig 构建 DTO(不暴露 apiSecret)。
@@ -117,14 +121,16 @@
.addPositionQuantity(config.getAddPositionQuantity())
.maxPositionPerSide(config.getMaxPositionPerSide())
.addPositionStartThreshold(config.getAddPositionStartThreshold())
+ .addPositionStopThreshold(config.getAddPositionStopThreshold())
.placeExcessTakeProfit(config.getPlaceExcessTakeProfit())
.dualStopLossEnabled(config.isDualStopLossEnabled())
.longStopLossPrice(config.getLongStopLossPrice())
.shortStopLossPrice(config.getShortStopLossPrice())
.tpTriggerOppositeAddEnabled(config.isTpTriggerOppositeAddEnabled())
.tpTriggerOppositeAddQuantity(config.getTpTriggerOppositeAddQuantity())
- .baseTakeProfitPerGrid(config.getBaseTakeProfitPerGrid())
- .baseTakeProfitGridCount(config.getBaseTakeProfitGridCount())
+ .tpPositionReplenishEnabled(config.isTpPositionReplenishEnabled())
+ .baseTakeProfitTotalQty(config.getBaseTakeProfitTotalQty())
+ .originalPositionReduce(config.getOriginalPositionReduce())
.build();
}
@@ -151,14 +157,16 @@
m.put("addPositionQuantity", addPositionQuantity);
m.put("maxPositionPerSide", maxPositionPerSide);
m.put("addPositionStartThreshold", addPositionStartThreshold);
+ m.put("addPositionStopThreshold", addPositionStopThreshold);
m.put("placeExcessTakeProfit", placeExcessTakeProfit);
m.put("dualStopLossEnabled", dualStopLossEnabled);
m.put("longStopLossPrice", longStopLossPrice);
m.put("shortStopLossPrice", shortStopLossPrice);
m.put("tpTriggerOppositeAddEnabled", tpTriggerOppositeAddEnabled);
m.put("tpTriggerOppositeAddQuantity", tpTriggerOppositeAddQuantity);
- m.put("baseTakeProfitPerGrid", baseTakeProfitPerGrid);
- m.put("baseTakeProfitGridCount", baseTakeProfitGridCount);
+ m.put("tpPositionReplenishEnabled", tpPositionReplenishEnabled);
+ m.put("baseTakeProfitTotalQty", baseTakeProfitTotalQty);
+ m.put("originalPositionReduce", originalPositionReduce);
return m;
}
@@ -192,14 +200,16 @@
.addPositionQuantity(1)
.maxPositionPerSide(0)
.addPositionStartThreshold(1)
+ .addPositionStopThreshold(0)
.placeExcessTakeProfit("off")
.dualStopLossEnabled(false)
.longStopLossPrice(null)
.shortStopLossPrice(null)
.tpTriggerOppositeAddEnabled(false)
.tpTriggerOppositeAddQuantity(0)
- .baseTakeProfitPerGrid(BigDecimal.ZERO)
- .baseTakeProfitGridCount(0)
+ .tpPositionReplenishEnabled(false)
+ .baseTakeProfitTotalQty(0)
+ .originalPositionReduce(0)
.build();
}
}
--
Gitblit v1.9.1