mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
Changes: - Update get_today_init_position_from_db to query trading_days table - Remove obsolete add_no_trade_record_to_db calls from BaseAgent - Simplify _handle_trading_result (trading_day record handles both scenarios) Root Cause: - Code was still querying old positions table after schema migration - The add_no_trade_record_to_db function is obsolete in new schema New Schema Behavior: - trading_day record created at session start (regardless of trading) - trading_day record updated at session end with final results - No separate "no-trade" record needed Impact: - Fixes: "no such table: positions" error in get_today_init_position_from_db - Removes unnecessary database writes for no-trade scenarios - Simplifies codebase by removing obsolete function calls Related: tools/price_tools.py:340-364, agent/base_agent/base_agent.py:661-673