fix: use 'no_trade' action type for initial position

Changed action_type from 'init' to 'no_trade' in _initialize_starting_position()
to comply with database CHECK constraint that only allows 'buy', 'sell', or 'no_trade'.

Fixes sqlite3.IntegrityError during position initialization.
This commit is contained in:
2025-11-02 21:49:57 -05:00
parent 019c84fca8
commit fcfdf36c1c

View File

@@ -334,7 +334,7 @@ class ModelDayExecutor:
) )
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
""", ( """, (
self.job_id, self.date, self.model_sig, 0, "init", self.job_id, self.date, self.model_sig, 0, "no_trade",
initial_cash, initial_cash, session_id, created_at initial_cash, initial_cash, session_id, created_at
)) ))