From fcfdf36c1cc7b6cf5e9e500844df45f6f7d96133 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 2 Nov 2025 21:49:57 -0500 Subject: [PATCH] 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. --- api/model_day_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/model_day_executor.py b/api/model_day_executor.py index 3fba7b4..3b75117 100644 --- a/api/model_day_executor.py +++ b/api/model_day_executor.py @@ -334,7 +334,7 @@ class ModelDayExecutor: ) 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 ))