Administrator
6 days ago 1bf3dca889dbcae6254e08b627e8ec672df7a4e2
src/main/java/com/xcong/excoin/modules/gateApi/GateConfigDTO.java
@@ -83,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)。
@@ -126,8 +128,9 @@
                .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();
    }
@@ -161,8 +164,9 @@
        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;
    }
@@ -203,8 +207,9 @@
                .shortStopLossPrice(null)
                .tpTriggerOppositeAddEnabled(false)
                .tpTriggerOppositeAddQuantity(0)
                .baseTakeProfitPerGrid(BigDecimal.ZERO)
                .baseTakeProfitGridCount(0)
                .tpPositionReplenishEnabled(false)
                .baseTakeProfitTotalQty(0)
                .originalPositionReduce(0)
                .build();
    }
}