移植期权复盘自动K线、时区修复与保存后轮询展示,与今日 crypto_monitor 改动对齐。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-09-15 11:51:41 +08:00
parent 45c7e73db5
commit d6bb99b5bb
13 changed files with 1165 additions and 368 deletions
+3 -9
View File
@@ -213,16 +213,10 @@ def option_history_row_key(
def _ms_to_iso(ms: Any) -> str | None:
val = _safe_float(ms)
if val is None or val <= 0:
return None
try:
from datetime import datetime, timezone
"""OKX ms → 业务时区墙钟(默认 Asia/Shanghai);勿用系统本地时区."""
from lib.options.options_time_lib import ms_to_options_app_str
dt = datetime.fromtimestamp(int(val) / 1000.0, tz=timezone.utc).astimezone()
return dt.strftime("%Y-%m-%d %H:%M:%S")
except (TypeError, ValueError, OSError):
return None
return ms_to_options_app_str(ms)
def option_instrument_meta_cached(