| | |
| | | longPriceQueue.clear(); |
| | | currentLongOrderIds.clear(); |
| | | currentShortOrderIds.clear(); |
| | | stopLossManager.resetAllEntryQuantities(); |
| | | |
| | | // 每次重启重新获取当前本金,确保盈亏对比基准正确 |
| | | refreshInitialPrincipal(); |
| | |
| | | if (shortGridElement != null && shortGridElement.isHasShortOrder()) { |
| | | int filledQty = Integer.parseInt(shortGridElement.getShortTraderParam().getQuantity()); |
| | | stopLossManager.clearShortEntryState(shortGridElement); |
| | | stopLossManager.resetShortEntryQty(); |
| | | stopLossManager.extendShortStopLoss(filledQty); |
| | | log.info("[OKX] 空单成交 gridId:{}, qty:{}, 追挂止损", shortGridElement.getId(), filledQty); |
| | | return; |
| | |
| | | if (longGridElement != null && longGridElement.isHasLongOrder()) { |
| | | int filledQty = Integer.parseInt(longGridElement.getLongTraderParam().getQuantity()); |
| | | stopLossManager.clearLongEntryState(longGridElement); |
| | | stopLossManager.resetLongEntryQty(); |
| | | stopLossManager.extendLongStopLoss(filledQty); |
| | | log.info("[OKX] 多单成交 gridId:{}, qty:{}, 追挂止损", longGridElement.getId(), filledQty); |
| | | return; |