Administrator
5 days ago f6080a67720f6241564589bb5b074661d8157f0f
src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java
@@ -121,6 +121,8 @@
    private final int maxPositionPerSide;
    /** 加仓启动阈值:前N次止损不触发加仓,默认 1(第1次止损不加仓,第2次起按公式计算) */
    private final int addPositionStartThreshold;
    /** 加仓停止阈值:启动加仓后按「加仓执行次数」计数,超过该值后加仓张数恢复为基础张数;0=不限制 */
    private final int addPositionStopThreshold;
    /** 止盈挂单模式:关闭 */
    public static final String EXCESS_TP_OFF = "off";
    /** 止盈挂单模式:集中止盈(挂在对手第一止损位) */
@@ -140,8 +142,8 @@
    private final boolean tpTriggerOppositeAddEnabled;
    /** 对向加仓挂单数量:止盈成交后在对向挂出的开仓张数,0=不启用。默认 0 */
    private final int tpTriggerOppositeAddQuantity;
    /** 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数。默认 0 */
    private final int baseTakeProfitPerGrid;
    /** 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数,支持小数。默认 0 */
    private final BigDecimal baseTakeProfitPerGrid;
    /** 止盈网格数量:基础仓位止盈挂单的网格数量。默认 0 */
    private final int baseTakeProfitGridCount;
    /** 网格绝对步长(shortBaseEntryPrice × gridRate),运行时由队列生成逻辑设置 */
@@ -184,6 +186,7 @@
        this.addPositionQuantity = builder.addPositionQuantity;
        this.maxPositionPerSide = builder.maxPositionPerSide;
        this.addPositionStartThreshold = builder.addPositionStartThreshold;
        this.addPositionStopThreshold = builder.addPositionStopThreshold;
        this.placeExcessTakeProfit = builder.placeExcessTakeProfit;
        this.dualStopLossEnabled = builder.dualStopLossEnabled;
        this.longStopLossPrice = builder.longStopLossPrice;
@@ -297,6 +300,8 @@
    public int getMaxPositionPerSide() { return maxPositionPerSide; }
    /** @return 加仓启动阈值:前N次止损不触发加仓 */
    public int getAddPositionStartThreshold() { return addPositionStartThreshold; }
    /** @return 加仓停止阈值:启动加仓后加仓执行次数上限,超过后加仓张数恢复基础张数;0=不限制 */
    public int getAddPositionStopThreshold() { return addPositionStopThreshold; }
    /** @return 止盈挂单模式:off=关闭 / concentrated=集中止盈 / dispersed=分散止盈 */
    public String getPlaceExcessTakeProfit() { return placeExcessTakeProfit; }
    /** @return 自定义止损开关:true=启用自定义止损触发价,false=使用默认阶梯止损 */
@@ -310,7 +315,7 @@
    /** @return 对向加仓挂单数量:止盈成交后在对向挂出的开仓张数 */
    public int getTpTriggerOppositeAddQuantity() { return tpTriggerOppositeAddQuantity; }
    /** @return 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数 */
    public int getBaseTakeProfitPerGrid() { return baseTakeProfitPerGrid; }
    public BigDecimal getBaseTakeProfitPerGrid() { return baseTakeProfitPerGrid; }
    /** @return 止盈网格数量:基础仓位止盈挂单的网格数量 */
    public int getBaseTakeProfitGridCount() { return baseTakeProfitGridCount; }
@@ -423,6 +428,8 @@
        private int maxPositionPerSide = 0;
        /** 加仓启动阈值:前N次止损不触发加仓,调整后的 effectiveCount = max(0, count - threshold)。默认 1 */
        private int addPositionStartThreshold = 1;
        /** 加仓停止阈值:启动加仓后按加仓执行次数计数,超过该值后加仓张数恢复基础张数,0=不限制。默认 0 */
        private int addPositionStopThreshold = 0;
        /** 止盈挂单模式:off=关闭 / concentrated=集中止盈 / dispersed=分散止盈,默认 off */
        private String placeExcessTakeProfit = EXCESS_TP_OFF;
        /** 自定义止损开关:true=启用自定义止损触发价,false=使用默认阶梯止损。默认 false */
@@ -436,7 +443,7 @@
        /** 对向加仓挂单数量:止盈成交后在对向挂出的开仓张数,默认 0 */
        private int tpTriggerOppositeAddQuantity = 0;
        /** 单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数,默认 0 */
        private int baseTakeProfitPerGrid = 0;
        private BigDecimal baseTakeProfitPerGrid = BigDecimal.ZERO;
        /** 止盈网格数量:基础仓位止盈挂单的网格数量,默认 0 */
        private int baseTakeProfitGridCount = 0;
@@ -500,6 +507,8 @@
        public Builder maxPositionPerSide(int maxPositionPerSide) { this.maxPositionPerSide = maxPositionPerSide; return this; }
        /** 设置加仓启动阈值:前N次止损不触发加仓,0=立即启动 */
        public Builder addPositionStartThreshold(int addPositionStartThreshold) { this.addPositionStartThreshold = addPositionStartThreshold; return this; }
        /** 设置加仓停止阈值:启动加仓后加仓执行次数上限,0=不限制 */
        public Builder addPositionStopThreshold(int addPositionStopThreshold) { this.addPositionStopThreshold = addPositionStopThreshold; return this; }
        /** 设置止盈挂单模式:off / concentrated / dispersed */
        public Builder placeExcessTakeProfit(String placeExcessTakeProfit) { this.placeExcessTakeProfit = placeExcessTakeProfit; return this; }
        /** 设置自定义止损开关:true=启用自定义止损触发价 */
@@ -513,7 +522,7 @@
        /** 设置对向加仓挂单数量:止盈成交后在对向挂出的开仓张数 */
        public Builder tpTriggerOppositeAddQuantity(int tpTriggerOppositeAddQuantity) { this.tpTriggerOppositeAddQuantity = tpTriggerOppositeAddQuantity; return this; }
        /** 设置单格止盈张数:基础仓位止盈挂单时每个网格挂的止盈张数 */
        public Builder baseTakeProfitPerGrid(int baseTakeProfitPerGrid) { this.baseTakeProfitPerGrid = baseTakeProfitPerGrid; return this; }
        public Builder baseTakeProfitPerGrid(BigDecimal baseTakeProfitPerGrid) { this.baseTakeProfitPerGrid = baseTakeProfitPerGrid; return this; }
        /** 设置止盈网格数量:基础仓位止盈挂单的网格数量 */
        public Builder baseTakeProfitGridCount(int baseTakeProfitGridCount) { this.baseTakeProfitGridCount = baseTakeProfitGridCount; return this; }