diff --git a/deploy/profile-scripts/mofin_db.py b/deploy/profile-scripts/mofin_db.py index 8498e8d2..effefd33 100644 --- a/deploy/profile-scripts/mofin_db.py +++ b/deploy/profile-scripts/mofin_db.py @@ -1960,7 +1960,7 @@ def snapshot_strategy_history(conn, code: str, source_trigger: str = "write_hold row = conn.execute( "SELECT code, name, decision_type, strategy_type, full_analysis, " "action, timing_signal, entry_low, entry_high, stop_loss, take_profit, " - "position_advice, rr_ratio, version, reassessed_at " + "position_advice, rr_ratio, version, strategy_name, reassessed_at " "FROM holding_strategies WHERE code=? AND status='active'", (code,) ).fetchone() @@ -1971,14 +1971,14 @@ def snapshot_strategy_history(conn, code: str, source_trigger: str = "write_hold INSERT INTO strategy_history (code, name, decision_type, strategy_type, full_analysis, action, timing_signal, entry_low, entry_high, stop_loss, take_profit, - position_advice, rr_ratio, version, source_trigger, reassessed_at, snapshotted_at) - VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) + position_advice, rr_ratio, version, strategy_name, source_trigger, reassessed_at, snapshotted_at) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) """, ( row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], - source_trigger, row[14], now + row[14], source_trigger, row[15], now )) conn.commit() # 每只股票只保留最近20条历史