fix(gateApi): 修复多空仓位追挂止损时最远止损gridId计算逻辑
- 修正多仓追挂止损时furthestSlId计算方式,使用配置的基础数量动态计算
- 修正空仓追挂止损时furthestSlId计算方式,使用配置的基础数量动态计算
- 移除硬编码的固定数值-11和11,改为基于baseQuantity的动态计算
- 提高了止损订单挂单位置的准确性和灵活性
| | |
| | | } |
| | | } |
| | | if (furthestSlId == 0) { |
| | | furthestSlId = -11; |
| | | furthestSlId = -(Integer.parseInt(config.getBaseQuantity()) + 1); |
| | | } |
| | | log.info("[Gate] 多仓追挂止损, 当前最远止损gridId:{}, 追加{}张", furthestSlId, filledQty); |
| | | for (int i = 0; i < filledQty; i++) { |
| | |
| | | } |
| | | } |
| | | if (furthestSlId == 0) { |
| | | furthestSlId = 11; |
| | | furthestSlId = Integer.parseInt(config.getBaseQuantity()) + 1; |
| | | } |
| | | log.info("[Gate] 空仓追挂止损, 当前最远止损gridId:{}, 追加{}张", furthestSlId, filledQty); |
| | | for (int i = 0; i < filledQty; i++) { |