Administrator
2026-07-22 13020c80158ec25202c6296286941932f8e89b02
src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java
@@ -107,6 +107,8 @@
    private final int stopLossCount;
    /** 止盈网格跨度:相邻止盈单跨越的网格数量,默认 2(即隔一格挂一个止盈单) */
    private final int takeProfitGridSpan;
    /** 价格驱动开关:true=启用K线推送中的价格驱动逻辑,false=禁用。默认 false */
    private final boolean priceDriveEnabled;
    /** 网格绝对步长(shortBaseEntryPrice × gridRate),运行时由队列生成逻辑设置 */
    private BigDecimal step;
    /** 网格元素列表,由队列初始化时同步填充,包含完整的多空仓挂单状态 */
@@ -140,6 +142,7 @@
        this.restartGridSpan = builder.restartGridSpan;
        this.stopLossCount = builder.stopLossCount;
        this.takeProfitGridSpan = builder.takeProfitGridSpan;
        this.priceDriveEnabled = builder.priceDriveEnabled;
    }
    // ==================== REST/WS 地址 ====================
@@ -231,6 +234,8 @@
    public int getStopLossCount() { return stopLossCount; }
    /** @return 止盈网格跨度:相邻止盈单跨越的网格数量,默认 2 */
    public int getTakeProfitGridSpan() { return takeProfitGridSpan; }
    /** @return 价格驱动开关:true=启用K线推送中的价格驱动逻辑,false=禁用 */
    public boolean isPriceDriveEnabled() { return priceDriveEnabled; }
    // ==================== 运行时参数 ====================
@@ -327,6 +332,8 @@
        private int stopLossCount = 0;
        /** 止盈网格跨度:相邻止盈单跨越的网格数量,默认 2 */
        private int takeProfitGridSpan = 2;
        /** 价格驱动开关:true=启用K线推送中的价格驱动逻辑,false=禁用。默认 true */
        private boolean priceDriveEnabled = true;
        /** 设置 API Key */
        public Builder apiKey(String apiKey) { this.apiKey = apiKey; return this; }
@@ -374,6 +381,8 @@
        public Builder stopLossCount(int stopLossCount) { this.stopLossCount = stopLossCount; return this; }
        /** 设置止盈网格跨度:相邻止盈单跨越的网格数量,默认 2 */
        public Builder takeProfitGridSpan(int takeProfitGridSpan) { this.takeProfitGridSpan = takeProfitGridSpan; return this; }
        /** 设置价格驱动开关:true=启用K线推送中的价格驱动逻辑,false=禁用 */
        public Builder priceDriveEnabled(boolean priceDriveEnabled) { this.priceDriveEnabled = priceDriveEnabled; return this; }
        public GateConfig build() {
            return new GateConfig(this);