From 1481d6e3ff291f7e942c239a27a6ea4ac4cd494c Mon Sep 17 00:00:00 2001 From: hmo Date: Sat, 15 Aug 2026 09:21:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B8=A9=E5=8C=BA=E8=A1=8C=E7=BB=84?= =?UTF-8?q?=E5=90=88=E7=BA=A7=E5=88=97=E6=98=BE=E7=A4=BA=E6=B8=A9=E5=8C=BA?= =?UTF-8?q?=E7=BA=A7=E7=BB=84=E5=90=88=E6=95=B0=E6=8D=AE=E2=80=94=E2=80=94?= =?UTF-8?q?regime=5Fwinrates=E6=89=A9=E5=B1=95=E8=AF=BBtotal=5Freturn/cagr?= =?UTF-8?q?/dd/capital/sharpe/pf,=E5=89=8D=E7=AB=AF=E6=B8=A9=E5=8C=BA?= =?UTF-8?q?=E8=A1=8C=E6=98=BE=E7=A4=BA=E6=B8=A9=E5=8C=BA=E7=BA=A7portfolio?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.py | 5 +++++ static/index.html | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/server.py b/server.py index fa05da56..64b5f32c 100644 --- a/server.py +++ b/server.py @@ -563,6 +563,11 @@ def api_research_strategies(): "cagr_pct": _r[7], "max_dd_pct": _r[8], "capital_final": _r[9], "positions_taken": _r[10], "sharpe_ratio": _r[11], "profit_factor": _r[12], + # 2026-08-15 温区级组合级指标(温区行也要显示组合级列) + "portfolio": {"cagr_pct": _r[7], "total_return_pct": _r[6], + "portfolio_max_dd_pct": _r[8], "capital_final": _r[9], + "positions_taken": _r[10], "sharpe_ratio": _r[11], + "profit_factor": _r[12]}, } _c.close() except Exception: diff --git a/static/index.html b/static/index.html index 64df84cf..efc05230 100644 --- a/static/index.html +++ b/static/index.html @@ -2442,13 +2442,14 @@ function renderStrategyTable(strategies) { const holdShow = rw && rw.avg_hold_days != null ? rw.avg_hold_days : (isOverall ? st.avg_hold_days : null); const sharpeShow = rw && rw.sharpe_ratio != null ? rw.sharpe_ratio : (isOverall ? st.sharpe_ratio : null); const pfShow = rw && rw.profit_factor != null ? rw.profit_factor : (isOverall ? st.profit_factor : null); - // 组合级列(综合/普适/全参与/最终资产/年化/回撤):整体行显示,温区行显示"—" + // 组合级列:整体行用整体组合;温区行用温区级组合(rw.portfolio,2026-08-15 温区级组合模拟数据) + const rwPf = rw && rw.portfolio ? rw.portfolio : null; const compositeShow = isOverall ? s._composite : null; const universalityShow = isOverall ? (st.universality || {}).score : null; - const retShow = isOverall ? (st.portfolio_full||{}).total_return_pct : null; - const capShow = isOverall ? (st.portfolio_full||pf).capital_final : null; - const cagrShow = isOverall ? (st.portfolio_full||pf).cagr_pct : null; - const ddShow = isOverall ? (st.portfolio_full||pf).portfolio_max_dd_pct : null; + const retShow = isOverall ? (st.portfolio_full||{}).total_return_pct : (rwPf ? rwPf.total_return_pct : null); + const capShow = isOverall ? (st.portfolio_full||pf).capital_final : (rwPf ? rwPf.capital_final : null); + const cagrShow = isOverall ? (st.portfolio_full||pf).cagr_pct : (rwPf ? rwPf.cagr_pct : null); + const ddShow = isOverall ? (st.portfolio_full||pf).portfolio_max_dd_pct : (rwPf ? rwPf.portfolio_max_dd_pct : null); const rowCls = 'border-b border-slate-800/50 hover:bg-slate-800/30 cursor-pointer' + (rgActive ? ' bg-emerald-900/20 border-l-2 border-l-emerald-400' : ''); ghtml += '' + '' +