diff --git a/lib/trading/position-manager.ts b/lib/trading/position-manager.ts index adb9bfe..a4077b4 100644 --- a/lib/trading/position-manager.ts +++ b/lib/trading/position-manager.ts @@ -869,13 +869,21 @@ export class PositionManager { return } - // 2. Stop loss + // 2. Stop loss (BEFORE TP1) if (!trade.tp1Hit && this.shouldStopLoss(currentPrice, trade)) { console.log(`🔴 STOP LOSS: ${trade.symbol} at ${profitPercent.toFixed(2)}%`) await this.executeExit(trade, 100, 'SL', currentPrice) return } + // 2b. CRITICAL: Runner stop loss (AFTER TP1, BEFORE TP2) + // This protects the runner position after TP1 closes main position + if (trade.tp1Hit && !trade.tp2Hit && this.shouldStopLoss(currentPrice, trade)) { + console.log(`🔴 RUNNER STOP LOSS: ${trade.symbol} at ${profitPercent.toFixed(2)}% (profit lock triggered)`) + await this.executeExit(trade, 100, 'SL', currentPrice) + return + } + // 3. Take profit 1 (closes configured %) if (!trade.tp1Hit && this.shouldTakeProfit1(currentPrice, trade)) { console.log(`🎉 TP1 HIT: ${trade.symbol} at ${profitPercent.toFixed(2)}%`)