refactor(okxApi): 移除基座止盈挂单逻辑
- 删除了基座多仓止盈挂单位置设置
- 删除了基座空仓止盈挂单位置设置
- 简化了网格交易服务中的订单执行流程
- 保留了初始止损挂单位置设置功能
| | |
| | | baseGridElement.setShortOrderId(baseShortTraderParam.getEntryOrderId()); |
| | | baseGridElement.setHasShortOrder(true); |
| | | |
| | | // 挂基座止盈 |
| | | { |
| | | BigDecimal tpPrice = baseGridElement.getGridPrice().add(config.getStep()); |
| | | executor.placeTakeProfit(tpPrice, "close_long", config.getBaseQuantity(), |
| | | profitId -> { |
| | | longTakeProfitTraderIdParam(baseGridElement, profitId, true); |
| | | log.info("[OKX] 基座多仓止盈已挂, gridId:0, 触发价:{}, tpId:{}", tpPrice, profitId); |
| | | }); |
| | | } |
| | | { |
| | | BigDecimal tpPrice = baseGridElement.getGridPrice().subtract(config.getStep()); |
| | | executor.placeTakeProfit(tpPrice, "close_short", config.getBaseQuantity(), |
| | | profitId -> { |
| | | shortTakeProfitTraderIdParam(baseGridElement, profitId, true); |
| | | log.info("[OKX] 基座空仓止盈已挂, gridId:0, 触发价:{}, tpId:{}", tpPrice, profitId); |
| | | }); |
| | | } |
| | | |
| | | // 挂初始止损 |
| | | int stopCount = Integer.parseInt(config.getBaseQuantity()) / Integer.parseInt(config.getQuantity()) + 1; |
| | | for (int id = 2; id <= stopCount; id++) { |