fix: Remove 5-candle time exit rule for v11.2 strategy
- Removed TIME_EXIT_5_CANDLE logic from position-manager.ts - v11.2 backtest (+53.80%) didn't include this exit rule - Trades will now be allowed to reach TP1 (+1.1%) instead of early exit - Previous behavior: Exit after 25min if MFE < $30 (force-exited -0.20% trade) - New behavior: Let trades run to configured TP1/SL levels Rationale: The 5-candle rule was from an older Q>=95 strategy optimization. v11.2 indicator already filters to PF 2.617 profitable setups, additional time-based filtering was counter-productive and introduced untested behavior.
This commit is contained in:
@@ -1639,31 +1639,6 @@ export class PositionManager {
|
||||
await this.saveTradeState(trade)
|
||||
}
|
||||
|
||||
// CRITICAL: Check 5-candle time exit (Dec 17, 2025)
|
||||
// Exit after 5 candles (25 minutes for 5m timeframe) if MFE < $30
|
||||
// This prevents long-duration losers from accumulating
|
||||
const tradeAgeMinutes = (Date.now() - trade.entryTime) / 60000
|
||||
const TIME_EXIT_CANDLES = 5
|
||||
const TIME_EXIT_MFE_THRESHOLD = 30 // $30 minimum MFE to stay in trade
|
||||
|
||||
if (!trade.tp1Hit && tradeAgeMinutes >= (TIME_EXIT_CANDLES * 5)) {
|
||||
// Check if trade has achieved meaningful profit
|
||||
const mfeDollars = (trade.positionSize * trade.maxFavorableExcursion) / 100
|
||||
|
||||
if (mfeDollars < TIME_EXIT_MFE_THRESHOLD) {
|
||||
logger.log(`⏰ TIME EXIT (5-candle rule): ${trade.symbol} after ${tradeAgeMinutes.toFixed(1)}min`)
|
||||
logger.log(` MFE: $${mfeDollars.toFixed(2)} < $${TIME_EXIT_MFE_THRESHOLD} threshold`)
|
||||
logger.log(` Current P&L: ${profitPercent.toFixed(2)}%`)
|
||||
await this.executeExit(trade, 100, 'TIME_EXIT_5_CANDLE' as any, currentPrice)
|
||||
return
|
||||
} else {
|
||||
// Log once when time threshold passed but MFE sufficient
|
||||
if (trade.priceCheckCount === Math.floor((TIME_EXIT_CANDLES * 5 * 60) / 2) + 1) {
|
||||
logger.log(`✅ 5-candle threshold passed but MFE $${mfeDollars.toFixed(2)} >= $${TIME_EXIT_MFE_THRESHOLD} - continuing`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CRITICAL: Check stop loss for runner (after TP1, before TP2)
|
||||
if (trade.tp1Hit && !trade.tp2Hit && this.shouldStopLoss(currentPrice, trade)) {
|
||||
logger.log(`🔴 RUNNER STOP LOSS: ${trade.symbol} at ${profitPercent.toFixed(2)}% (profit lock triggered)`)
|
||||
|
||||
Reference in New Issue
Block a user