Files
trading_bot_v4/lib/startup
mindesbunister cdd3a5dcb0 critical: Fix startup validator reopening duplicate trades
- Group trades by symbol before validation
- Keep only most recent trade per symbol
- Close older duplicates with DUPLICATE_CLEANUP reason
- Prevents reopening old closed trades when checking recent trades

Bug: Startup validator was reopening ALL closed trades for a symbol
if Drift showed one position, causing 3 trades to be tracked when
only 1 actual position existed on Drift.

Impact: Position Manager was tracking ghost positions, causing
confusion and potential missed risk management.
2025-11-16 21:49:26 +01:00
..