From a1090c17e0543e0dbc0789d472eb8bba0cfed40f Mon Sep 17 00:00:00 2001 From: hmo Date: Wed, 29 Jul 2026 11:32:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B8=82=E5=9C=BA=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E8=AF=AD=E4=B9=89=E4=BF=AE=E6=AD=A3(=E6=B8=AF=E8=82=A1?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E5=8F=AA=E6=98=BE=E7=A4=BA=E6=B8=AF=E8=82=A1?= =?UTF-8?q?)+=E5=BD=93=E5=89=8D=E5=BE=BD=E7=AB=A0=E4=BB=85A=E8=82=A1v7.1+?= =?UTF-8?q?=E6=B8=AF=E8=82=A1=E7=89=88=E6=9C=AC=E6=B2=89=E5=BA=95=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E2=80=94=E2=80=94v7.1=E8=BA=AB=E4=BB=BD=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E8=A2=AB=E6=B8=AF=E8=82=A1=E5=88=86=E8=BA=AB=E6=B7=B7?= =?UTF-8?q?=E6=B7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/index.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index c7ea616e..d284ab1c 100644 --- a/static/index.html +++ b/static/index.html @@ -1950,7 +1950,9 @@ async function loadStrategyList() { if (data.error) { listEl.innerHTML = '
' + data.error + '
'; return; } const mkt = document.getElementById('btMarket')?.value || 'all'; let strats = data.strategies || []; - if (mkt !== 'all') strats = strats.filter(s => (s.market || 'all') === mkt || (s.market || 'all') === 'all'); + // 市场语义:'all'=未分市场的A股回测(港股回填前跑的),'hk'=港股宇宙,'a'=显式A股 + if (mkt === 'hk') strats = strats.filter(s => (s.market || 'all') === 'hk'); + else if (mkt === 'a') strats = strats.filter(s => (s.market || 'all') !== 'hk'); renderStrategyTable(strats); } catch(e) { listEl.innerHTML = '
加载失败: ' + e.message + '
'; @@ -1960,6 +1962,13 @@ async function loadStrategyList() { function renderStrategyTable(strategies) { const el = document.getElementById('strategyList'); if (!strategies.length) { el.innerHTML = '
暂无策略版本
'; return; } + // 非港股版本在前,港股分身沉底且同版本内非港在前(2026-07-29 老爸:v7.1身份不被港股分身混淆) + strategies.sort((a, b) => { + const am = (a.market || 'all') === 'hk' ? 1 : 0; + const bm = (b.market || 'all') === 'hk' ? 1 : 0; + if (am !== bm) return am - bm; + return (a.version || '').localeCompare(b.version || ''); + }); // 找每列最优值用于高亮 const best = { win_rate: -999, sharpe_ratio: -999, profit_factor: -999, avg_profit_pct: -999, total_return_pct: -999, cagr_pct: -999, portfolio_max_dd_pct: 999 }; @@ -2036,7 +2045,7 @@ function renderStrategyTable(strategies) { const pf = st.portfolio || {}; const hasResult = st.total_trades != null; const smallSample = hasResult && st.total_trades < 40; - const isCurrent = s.version === CURRENT_STRATEGY; + const isCurrent = s.version === CURRENT_STRATEGY && (s.market || 'all') !== 'hk'; const retCls = pf.total_return_pct == null ? '' : (pf.total_return_pct >= 0 ? 'text-green-400' : 'text-red-400'); const rowCls = 'border-b border-slate-800/50 hover:bg-slate-800/30 cursor-pointer' + (isCurrent ? ' bg-emerald-900/20 border-l-2 border-l-emerald-400' : ''); html += '' +