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:
mindesbunister
2025-12-27 20:21:37 +01:00
parent 9781eba6d9
commit 90362526c4
2 changed files with 2 additions and 27 deletions

4
.env
View File

@@ -104,7 +104,7 @@ TAKE_PROFIT_1_PERCENT=1.1
# Take Profit 1 Size: What % of position to close at TP1
# 60 = close 60%, leave 40% for runner
TAKE_PROFIT_1_SIZE_PERCENT=60
TAKE_PROFIT_1_SIZE_PERCENT=100
# Take Profit 2: Trigger trailing stop at this profit level (FALLBACK)
# Example: +1.8% on 10x = +18% account gain
@@ -388,7 +388,7 @@ NEW_RELIC_LICENSE_KEY=
# - TRADING_BOT_V4_MANUAL.md - Complete manual
# - PHASE_2_COMPLETE_REPORT.md - Feature summary
USE_TRAILING_STOP=true
USE_TRAILING_STOP=false
TRAILING_STOP_PERCENT=0.5
TRAILING_STOP_ACTIVATION=0.4
MIN_SIGNAL_QUALITY_SCORE=95

View File

@@ -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)`)