Administrator
2026-05-28 0017064558c515665645c3da68e073ec4a4c7ddf
feat(gateApi): 添加保证金比例限制和网格队列容量配置选项

- 在 GateConfig 中新增 marginRatioLimit 配置项用于设置保证金占初始本金比例上限
- 在 GateConfig 中新增 gridQueueSize 配置项用于设置网格队列容量
- 启用被注释的 TPonUserTradeShortEntry 和 TPonUserTradeLongEntry 方法调用
- 优化网格交易逻辑,将开仓位置判断从当前网格改为相邻上下网格
- 修复网格遍历逻辑,确保正确的多空仓位开仓顺序
- 移除冗余的注释代码和无用变量声明
1 files modified
6 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -810,15 +810,15 @@
            GridElement upGridElement = GridElement.findById(gridElement.getUpId());
            if (upGridElement != null){
                BigDecimal upGridPrice = upGridElement.getGridPrice();
                TraderParam downLongTraderParam = upGridElement.getLongTraderParam();
                TraderParam upLongTraderParam = upGridElement.getLongTraderParam();
                if (
                        !upGridElement.isHasLongOrder() &&
                                upGridPrice.compareTo(longEntryPrice) <= 0
                ){
                    placeEntryOrderWithPreFlag(upGridElement, true,
                            downLongTraderParam.getEntryPrice(),
                            upLongTraderParam.getEntryPrice(),
                            FuturesPriceTrigger.RuleEnum.NUMBER_1,
                            downLongTraderParam.getQuantity());
                            upLongTraderParam.getQuantity());
                }
            }
        }