Administrator
2026-06-09 3a937b6e544597e6b8897cfe78737e60b5d07805
fix(gateApi): 修复多空仓位追挂止损时最远止损gridId计算逻辑

- 修正多仓追挂止损时furthestSlId计算方式,使用配置的基础数量动态计算
- 修正空仓追挂止损时furthestSlId计算方式,使用配置的基础数量动态计算
- 移除硬编码的固定数值-11和11,改为基于baseQuantity的动态计算
- 提高了止损订单挂单位置的准确性和灵活性
1 files modified
4 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -1405,7 +1405,7 @@
            }
        }
        if (furthestSlId == 0) {
            furthestSlId = -11;
            furthestSlId = -(Integer.parseInt(config.getBaseQuantity()) + 1);
        }
        log.info("[Gate] 多仓追挂止损, 当前最远止损gridId:{}, 追加{}张", furthestSlId, filledQty);
        for (int i = 0; i < filledQty; i++) {
@@ -1438,7 +1438,7 @@
            }
        }
        if (furthestSlId == 0) {
            furthestSlId = 11;
            furthestSlId = Integer.parseInt(config.getBaseQuantity()) + 1;
        }
        log.info("[Gate] 空仓追挂止损, 当前最远止损gridId:{}, 追加{}张", furthestSlId, filledQty);
        for (int i = 0; i < filledQty; i++) {