Show pure-options header trade stats on every navigation page.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user