From c9d47b651ab29237899ff4e068844929fab79098 Mon Sep 17 00:00:00 2001 From: hmo Date: Thu, 30 Jul 2026 01:35:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=9E=E6=92=A4=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E9=94=AE=E5=AF=B9=E9=BD=90MC=E6=98=BE=E7=A4=BA=E5=80=BC+?= =?UTF-8?q?=E5=9B=9E=E6=92=A4=E7=B1=BB=E9=BB=98=E8=AE=A4=E5=8D=87=E5=BA=8F?= =?UTF-8?q?(=E5=B0=8F=E5=9B=9E=E6=92=A4=E4=BC=98=E5=85=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index b32bd035..80595079 100644 --- a/static/index.html +++ b/static/index.html @@ -1959,12 +1959,13 @@ async function loadStrategyList() { } } +const ASC_DEFAULT = new Set(['max_dd']); // 回撤类:小=好,默认升序 function sortBy(key) { if (window._sortKey === key) { window._sortDir = window._sortDir === 'desc' ? 'asc' : 'desc'; } else { window._sortKey = key; - window._sortDir = 'desc'; + window._sortDir = ASC_DEFAULT.has(key) ? 'asc' : 'desc'; } renderStrategyTable(window._strats || []); } @@ -1988,7 +1989,7 @@ function sortStrategies(strategies, key, dir) { case 'avg_profit': return st.avg_profit_pct != null ? st.avg_profit_pct : -999; case 'sharpe': return st.sharpe_ratio != null ? st.sharpe_ratio : -999; case 'profit_factor': return st.profit_factor != null ? st.profit_factor : -999; - case 'max_dd': return pf.portfolio_max_dd_pct != null ? pf.portfolio_max_dd_pct : 999; + case 'max_dd': return (st.portfolio_full || pf).portfolio_max_dd_pct != null ? (st.portfolio_full || pf).portfolio_max_dd_pct : 999; default: return 0; } };