修复期权开平仓时间按 UTC 入库导致复盘K线标记偏8小时:统一业务时区并一次性迁移。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-09-15 11:20:39 +08:00
parent 0132ca4ca1
commit 72ad8ea7dc
8 changed files with 245 additions and 40 deletions
+4 -1
View File
@@ -361,12 +361,15 @@ def close_option_by_bid1(
ELSE signal_note
END"""
params.append(signal_note)
from lib.options.options_time_lib import options_app_now_str
params.append(options_app_now_str())
params.append(int(row["id"]))
conn.execute(
f"""
UPDATE options_trades
SET status = 'closed', close_quote = ?, premium_received = ?,
realized_pnl = ?, close_ord_id = ?, closed_at = CURRENT_TIMESTAMP
realized_pnl = ?, close_ord_id = ?, closed_at = ?
{note_sql}
WHERE id = ?
""",