feat: 列表双口径——新增全参与收益主列(单仓≥5万公平基线),集中仓为辅列,v11.0现原形(全参与仅+28.9%)

This commit is contained in:
hmo
2026-07-29 15:32:54 +08:00
parent 260354bdd3
commit 0bbc489a1b
2 changed files with 8 additions and 3 deletions
+5 -2
View File
@@ -1979,6 +1979,7 @@ function sortStrategies(strategies, key, dir) {
case 'composite': return s._composite != null ? s._composite : -999;
case 'universality': return (st.universality || {}).score || 0;
case 'total_return': return pf.total_return_pct != null ? pf.total_return_pct : -999;
case 'full_return': return (st.portfolio_full || {}).total_return_pct != null ? st.portfolio_full.total_return_pct : -999;
case 'capital_final': return pf.capital_final || 0;
case 'cagr': return pf.cagr_pct != null ? pf.cagr_pct : -999;
case 'trades': return st.total_trades || 0;
@@ -2084,7 +2085,8 @@ function renderStrategyTable(strategies) {
th('sizing_slots', '仓位', 'text-center') +
th('composite', '综合', 'text-right') +
th('universality', '普适', 'text-right') +
th('total_return', '总收益', 'text-right') +
th('full_return', '全参与', 'text-right') +
th('total_return', '集中仓', 'text-right') +
th('capital_final', '最终资产', 'text-right') +
th('cagr', '年化', 'text-right') +
th('trades', '交易数', 'text-right') +
@@ -2107,7 +2109,8 @@ function renderStrategyTable(strategies) {
'<td class="text-center px-2 py-1.5 font-mono text-cyan-300">' + (st.sizing_slots ? st.sizing_slots + '仓' : '10仓') + '</td>' +
cell('composite', s._composite, v => v, 'font-bold text-amber-300') +
cell('universality_score', (st.universality || {}).score, v => v + '<span class="text-slate-500">/' + (st.universality || {}).months + '月</span>') +
cell('total_return_pct', pf.total_return_pct, v => v + '%', 'font-bold ' + retCls + ' ' + hl(pf.total_return_pct, best.total_return_pct)) +
cell('total_return_pct', (st.portfolio_full || {}).total_return_pct, v => v + '%', 'font-bold text-amber-300') +
cell('total_return_pct', pf.total_return_pct, v => v + '%', retCls + ' ' + hl(pf.total_return_pct, best.total_return_pct)) +
cell('capital_final', pf.capital_final, v => '¥' + (v/10000).toFixed(0) + '万') +
cell('cagr_pct', pf.cagr_pct, v => v + '%', hl(pf.cagr_pct, best.cagr_pct)) +
cell('total_trades', st.total_trades, v => v) +
+3 -1
View File
@@ -1012,11 +1012,13 @@ def run_backtest(strategy_version, start_date, end_date, capital=1000000, save=T
i += step
summary = calc_summary(trades, capital)
# 组合级资产模拟:用该策略自己的最优仓位模型(波段策略大仓少股,固定出场小仓多股)
if summary:
# 集中仓位(该策略最优激进仓位)
slots = STRATEGY_SIZING.get(strategy_version, 10)
summary['portfolio'] = portfolio_sim(trades, capital, slots)
summary['sizing_slots'] = slots
# 全参与可行仓位(公平基线:单仓≥5万地板,消除上车运气)
summary['portfolio_full'] = portfolio_sim_full(trades, capital)
result = {
'strategy': strat['version'],
'strategy_name': strat['name'],