From 9036aa73f2d9868d20093de78d592376f25f2cb2 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 30 Sep 2026 22:07:16 +0800
Subject: [PATCH] fix(gateApi): 修复网格交易中持仓大小计算问题
---
src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java | 20 ++++++++++++++++++++
1 files changed, 20 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 aa04156..5cd93fd 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
@@ -77,6 +77,14 @@
private BigDecimal longStopLossPrice;
/** 空仓自定义止损触发价(价格涨至该值触发平空),null=未设置 */
private BigDecimal shortStopLossPrice;
+ /** 止盈成交触发对向加仓开关:true=启用,false=禁用。null=未设置(默认false) */
+ private Boolean tpTriggerOppositeAddEnabled;
+ /** 对向加仓挂单数量:止盈成交后在对向挂出的开仓张数,0=不启用 */
+ private Integer tpTriggerOppositeAddQuantity;
+ /** 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数,支持小数,0=不启用 */
+ private BigDecimal baseTakeProfitPerGrid;
+ /** 止盈网格数量:基础仓位止盈挂单的网格数量,0=不启用 */
+ private Integer baseTakeProfitGridCount;
/**
* 从 GateConfig 构建 DTO(不暴露 apiSecret)。
@@ -113,6 +121,10 @@
.dualStopLossEnabled(config.isDualStopLossEnabled())
.longStopLossPrice(config.getLongStopLossPrice())
.shortStopLossPrice(config.getShortStopLossPrice())
+ .tpTriggerOppositeAddEnabled(config.isTpTriggerOppositeAddEnabled())
+ .tpTriggerOppositeAddQuantity(config.getTpTriggerOppositeAddQuantity())
+ .baseTakeProfitPerGrid(config.getBaseTakeProfitPerGrid())
+ .baseTakeProfitGridCount(config.getBaseTakeProfitGridCount())
.build();
}
@@ -143,6 +155,10 @@
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);
return m;
}
@@ -180,6 +196,10 @@
.dualStopLossEnabled(false)
.longStopLossPrice(null)
.shortStopLossPrice(null)
+ .tpTriggerOppositeAddEnabled(false)
+ .tpTriggerOppositeAddQuantity(0)
+ .baseTakeProfitPerGrid(BigDecimal.ZERO)
+ .baseTakeProfitGridCount(0)
.build();
}
}
--
Gitblit v1.9.1