Files
trading_bot_v4/.github
mindesbunister 9c58645029 docs: Add Common Pitfall #75 - Wrong year in SQL queries
CRITICAL LESSON LEARNED (Dec 8, 2025):
- Database has 2024 dates, current date is 2025
- Query 'WHERE exitTime >= 2024-12-07' matches Oct-Dec (247 rows)
- Should query 'WHERE exitTime >= 2025-12-07' (6 rows)
- Result: Reported -$1,616 loss instead of actual -$137.55 (12× inflation)
- User was RIGHT with $120.89 figure, AI agent wrong due to year mismatch

PREVENTION:
- Always use NOW() or CURRENT_DATE for relative queries
- Never hardcode year without verification
- Check row counts before declaring results
- Include YYYY-MM-DD in SELECT to catch mismatches
- Trust user's numbers when they dispute - verify query year first

This is a REAL MONEY system - wrong numbers = wrong decisions.
Drift tells the truth. User was right. Verify queries.
2025-12-08 08:57:24 +01:00
..