fix: 温区行组合级指标显示'——'——温区交易分散(如v_lurk_v3 trend_down散在2017-2025共621日),拼接组合模拟的时间轴错乱导致944%收益配33.8%年化的矛盾;温区行只显示交易统计(胜率/均盈/盈亏比/夏普/样本/持有),组合级列(年化/资产/全参与/回撤)只整体行显示

This commit is contained in:
hmo
2026-08-13 13:03:40 +08:00
parent 7972f6031e
commit d34ae18322
+10 -7
View File
@@ -2385,17 +2385,20 @@ function renderStrategyTable(strategies) {
const isOverall = rg === 'overall';
const rgMeta = REGIME_META[rg] || {icon:'🌐', name: rg === 'overall' ? '整体' : rg};
const rgActive = !isOverall && isCurrent;
// ── 温区行数据:所有列用该温区数据rw 有则用,无则"—")──
// ── 温区行数据:交易统计用该温区数据;组合级指标温区不适用(温区分散不成连续组合)──
const wrShow = rw && rw.win_rate != null ? rw.win_rate : (isOverall ? st.win_rate : null);
const pnlShow = rw && rw.avg_pnl != null ? rw.avg_pnl : (isOverall ? st.avg_profit_pct : null);
const tradesShow = rw && rw.trades != null ? rw.trades : (isOverall ? st.total_trades : null);
const holdShow = rw && rw.avg_hold_days != null ? rw.avg_hold_days : (isOverall ? st.avg_hold_days : null);
const cagrShow = rw && rw.cagr_pct != null ? rw.cagr_pct : (isOverall ? (st.portfolio_full||pf).cagr_pct : null);
const retShow = rw && rw.total_return_pct != null ? rw.total_return_pct : (isOverall ? (st.portfolio_full||{}).total_return_pct : null);
const ddShow = rw && rw.max_dd_pct != null ? rw.max_dd_pct : (isOverall ? (st.portfolio_full||pf).portfolio_max_dd_pct : null);
const capShow = rw && rw.capital_final != null ? rw.capital_final : (isOverall ? (st.portfolio_full||pf).capital_final : 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);
// 组合级列(综合/普适/全参与/最终资产/年化/回撤):整体行显示,温区行显示"—"
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 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 += '<tr class="' + rowCls + '" onclick="showStrategyDetail(\'' + s.version + '\')">' +
'<td class="px-2 py-1.5 whitespace-nowrap">' +
@@ -2409,8 +2412,8 @@ function renderStrategyTable(strategies) {
'<td class="px-2 py-1.5 whitespace-normal break-words" title="' + (s.hypothesis || s.summary || '').replace(/"/g, '&quot;') + '">' + (s.name || '') + (smallSample ? ' <span class="text-amber-500" title="样本<40笔">⚠️</span>' : '') + '</td>' +
'<td class="text-center px-2 py-1.5 font-mono text-cyan-300">' + (st.sizing_slots ? st.sizing_slots + '仓' : '10仓') + (st.conviction_model ? '<button onclick="event.stopPropagation();showConviction(\'' + s.version + '\')" class="text-amber-400 hover:text-amber-300" title="查看信念分级仓位规则">⚡</button>' : '') + '</td>' +
'<td class="text-center px-2 py-1.5">' + ((s.description && s.description.title) ? '<button onclick="event.stopPropagation();showDesc(\'' + s.version + '\')" class="text-blue-400 hover:text-blue-300" title="查看策略说明">📖</button>' : '<span class="text-slate-700">—</span>') + '</td>' +
cell('composite', isOverall ? s._composite : null, v => v + (s._confidence != null && s._confidence < 1 ? '<span class="text-slate-500 text-[10px]">×' + s._confidence.toFixed(2) + '</span>' : ''), 'font-bold text-amber-300') +
cell('universality_score', isOverall ? (st.universality || {}).score : null, v => v + '<span class="text-slate-500">/' + (st.universality || {}).months + '月</span>') +
cell('composite', compositeShow, v => v + (s._confidence != null && s._confidence < 1 ? '<span class="text-slate-500 text-[10px]">×' + s._confidence.toFixed(2) + '</span>' : ''), 'font-bold text-amber-300') +
cell('universality_score', universalityShow, v => v + '<span class="text-slate-500">/' + (st.universality || {}).months + '月</span>') +
cell('full_return_pct', retShow, v => v + '%', 'font-bold text-amber-300') +
cell('capital_final', capShow, v => '¥' + (v/10000).toFixed(0) + '万') +
cell('cagr_pct', cagrShow, v => v + '%', hl(cagrShow, best.cagr_pct)) +