Show pure-options header trade stats on every navigation page.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-16 16:13:27 +08:00
parent 48ea7e1bc7
commit 72d8daf15c
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -5134,7 +5134,8 @@ def render_main_page(page="options", embed_mode=None):
records = []
total = rate = 0
profit_loss_ratio = None
if page == "options" and OKX_OPTIONS_ENABLED:
# 顶栏总交易/胜率/盈亏比:期权开启时全站读纯期权,与当前导航页无关
if OKX_OPTIONS_ENABLED:
try:
from lib.options.options_stats_lib import header_options_stats_for_window
@@ -5492,8 +5493,7 @@ def api_account_snapshot():
)
header_trade_stats = header_trade_stats_for_window(conn, _list_window_from_request(), APP_TZ)
page_hint = (request.args.get("page") or "").strip().lower()
if page_hint == "options" and OKX_OPTIONS_ENABLED:
if OKX_OPTIONS_ENABLED:
try:
from lib.options.options_stats_lib import header_options_stats_for_window
+1 -1
View File
@@ -177,7 +177,7 @@ def _stats_from_option_trade_rows(closed_rows, open_rows) -> dict[str, Any]:
def header_options_stats_for_window(conn, list_window: dict[str, Any], app_tz) -> dict[str, Any]:
"""顶栏:纯期权(options_trades)总交易/胜率/盈亏比,按列表窗过滤."""
"""顶栏总交易/胜率/盈亏比:纯期权(options_trades),全站导航共用,按列表窗过滤."""
from lib.common.history_window_lib import utc_window_to_bj_sql_strings
init_options_tables(conn)