修复期权开平仓时间按 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
+5 -2
View File
@@ -407,6 +407,8 @@ def open_coin_option_buy_full(
def _insert_coin_trade(conn: Any, **kwargs: Any) -> int:
from lib.options.options_time_lib import options_app_now_str
pe = 1 if kwargs.get("profit_exit_enabled") else 0
pe_mult = float(kwargs.get("profit_exit_mult") or 1.0)
pe_state = "active" if pe else "idle"
@@ -416,8 +418,8 @@ def _insert_coin_trade(conn: Any, **kwargs: Any) -> int:
inst_id, underlying, opt_type, strike, exp_time, sheets, eth_amount,
open_quote, premium_paid, status, signal_note, exchange_ord_id,
margin_mode, premium_ccy, bridge_id, budget_usdt,
profit_exit_enabled, profit_exit_mult, profit_exit_state
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 'open', ?, ?, 'coin', ?, ?, ?, ?, ?, ?)
profit_exit_enabled, profit_exit_mult, profit_exit_state, created_at
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 'open', ?, ?, 'coin', ?, ?, ?, ?, ?, ?, ?)
""",
(
kwargs["inst_id"],
@@ -437,6 +439,7 @@ def _insert_coin_trade(conn: Any, **kwargs: Any) -> int:
pe,
pe_mult,
pe_state,
options_app_now_str(),
),
)
conn.commit()