Files
trading_bot_v4/lib
mindesbunister 0909846ac5 debug: Add comprehensive logging to Position Manager checkTradeConditions (Bug #77 recurrence)
CRITICAL INVESTIGATION (Dec 15, 2025):
- Monitoring loop runs every 2s: "🔍 Price check: SOL-PERP @ $124.47 (1 trades)" ✓
- But NO condition checks execute: No TP1/TP2/SL detection, no executeExit calls 
- Impact: ,000+ losses - 96% data loss ($32.98 actual vs $1.23 recorded)

Added debug logging:
- STARTCHK: Function entry (price, entry, check count)
- DRIFT: Position size and existence from Drift API
- AGE: Trade age in seconds vs 30s threshold

Purpose: Identify WHERE checkTradeConditions() returns early before reaching condition checks at line 1497+

Hypothesis: Either Drift returns size=0 OR trade age check fails, causing early return at line 711
2025-12-15 22:44:20 +01:00
..