From 4b877fb26aca7c2f58289b2fd06a31108453861e Mon Sep 17 00:00:00 2001 From: hmo Date: Sat, 1 Aug 2026 01:03:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=9B=E5=8C=96=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E7=89=88=E2=80=94=E2=80=94=E5=9F=BA=E7=BA=BF?= =?UTF-8?q?=E5=AF=B9=E6=AF=94+=E5=81=A5=E5=BA=B7=E5=BA=A6+=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E5=8E=86=E5=8F=B2+=E5=9B=9E=E6=B5=8B=E6=95=99?= =?UTF-8?q?=E8=AE=AD(=E6=A0=87=E6=B3=A8=E6=9D=A5=E6=BA=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/index.html | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) 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});