Administrator
2026-06-05 1b55621d4dcf3b4ee6b9c4beb81ad69e5b7a5856
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridTradeService.java
@@ -215,6 +215,7 @@
        longPriceQueue.clear();
        currentLongOrderIds.clear();
        currentShortOrderIds.clear();
        stopLossManager.resetAllEntryQuantities();
        // 每次重启重新获取当前本金,确保盈亏对比基准正确
        refreshInitialPrincipal();
@@ -432,6 +433,7 @@
        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;
@@ -440,6 +442,7 @@
        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;