diff --git a/static/index.html b/static/index.html index a9361804..8b9e1816 100644 --- a/static/index.html +++ b/static/index.html @@ -1979,24 +1979,47 @@ async function loadEvolutionBox() { try { const r = await fetch('/api/evolution/dashboard'); const d = await r.json(); - let h = '
🧬 策略自我进化
'; + let h = '
🧬 策略自我进化
'; + + // ── 基线对比 ── if (d.baseline) { - h += '
'; + h += '
5年回测基线:'; for (const [v, b] of Object.entries(d.baseline)) { const clr = v === 'v_next4' ? 'text-emerald-400' : 'text-slate-300'; - h += '
'+v+'
胜率'+b.win_rate+'% 收益'+b.total_return+'% 回撤'+b.max_dd+'%
'; + h += '
'+v+'
胜率'+b.win_rate+'% 收益'+b.total_return+'% 回撤'+b.max_dd+'%
'; } h += '
'; } - if (d.health && d.health.length > 0) { const hs = d.health[0]; const sc = hs.health_score; + + // ── 健康度 ── + if (d.health && d.health.length > 0) { + const hs = d.health[0]; const sc = hs.health_score; const color = sc >= 70 ? 'text-emerald-400' : sc >= 50 ? 'text-amber-400' : 'text-red-400'; - h += '
健康度: '+sc+'分 (实盘'+hs.live_trades+'笔)
'; } - if (d.lessons && d.lessons.length > 0) { - h += '
📝 最近教训:
'; - for (const l of d.lessons.slice(0,3)) h += '
'+(l.lesson_type==='win_pattern'?'✅':'❌')+' '+l.lesson_text+'
'; + h += '
健康度: '+sc+'分 (实盘'+hs.live_trades+'笔 vs 回测'+hs.backtest_wr+'%胜率)'; + if (hs.live_trades === 0) h += ' [暂无实盘数据, 分数为中性]'; + h += '
'; } + + // ── 进化历史 ── + if (d.evolution && d.evolution.length > 0) { + h += '
🔄 迭代历史:
'; + for (const e of d.evolution.slice(0,5)) { + h += '
'+e.parent_version+' → '+e.child_version+' '+e.change_description+''+(e.promoted?' ✅采纳':'')+'
'; + } + } else { + h += '
🔄 迭代历史: 暂无 (auto_iterator 待触发)
'; + } + + // ── 教训 ── + if (d.lessons && d.lessons.length > 0) { + h += '
📝 回测教训 (基于v_next4 5y交易分析):
'; + for (const l of d.lessons.slice(0,5)) { + h += '
'+(l.lesson_type==='win_pattern'?'✅盈利规律':'❌亏损规律')+' '+l.lesson_text+' '+Math.round(l.confidence*100)+'%置信
'; + } + } + box.innerHTML = h; - } catch (e) { box.innerHTML = '
加载失败
'; } + } catch (e) { box.innerHTML = '
进化模块加载失败: '+e.message+'
'; } } // 研究Tab活跃时加载进化模块 new MutationObserver(()=>{if(!document.getElementById('tab-research')?.classList?.contains('hidden'))loadEvolutionBox();}).observe(document.body,{attributes:true,subtree:true});