Files
mt5_report_parser/output/walk_forward.html
T
gavindiaz ed8e8afb44 Initial commit: MT5 EA 回测报告分析工具集
通用可复用的 MT5 回测分析工具,不针对任何具体 EA:

- mt5_report_parser.py: 解析 MT5 中文 xlsx 报告,重建逐笔交易
- run_analysis.py: 主分析器,IS/OSS 对比 + What-If + 蒙特卡洛 + 数据驱动建议
- walk_forward.py: Walk-Forward 滚动 IS→OOS 验证 (WFE/泛化相关性)
- param_scan.py: 参数敏感度扫描,高原检测 + 输出优化后 .set
- mae_mfe.py: MAE/MFE 分析 + TP/SL 扫描,附 MQL5 导出代码

所有输出为自包含 HTML (内联 SVG,无图片依赖)。
2026-06-28 02:31:54 +08:00

23 lines
4.8 KiB
HTML

<!doctype html><html lang="zh-CN"><head><meta charset="utf-8">
<title>Walk-Forward 报告 — demo</title>
<style>
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background:#f8fafc; color:#111827; margin:0; padding:20px;}
.wrap { max-width:1100px; margin:0 auto;}
h1 { color:#1e3a8a; border-bottom:3px solid #1e3a8a; padding-bottom:8px;}
table.data { border-collapse:collapse; width:100%; background:#fff; margin:8px 0 16px; font-size:12px;}
table.data th, table.data td { border:1px solid #e2e8f0; padding:5px 7px; text-align:left;}
table.data th { background:#f1f5f9;}
td.pos, tr.pos td { color:#16a34a;} td.neg, tr.neg td { color:#dc2626;}
.muted { color:#6b7280; font-size:12px;}
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; margin:16px 0;}
.card { background:#fff; padding:14px; border-radius:8px; border:1px solid #e2e8f0;}
.card .k { color:#6b7280; font-size:12px;} .card .v { font-size:20px; font-weight:600; margin-top:4px;}
.card .v.pos { color:#16a34a;} .card .v.neg { color:#dc2626;}
.chart { width:100%; height:auto; background:#fff; border:1px solid #e2e8f0; border-radius:6px;}
.note { background:#fef3c7; border-left:4px solid #f59e0b; padding:10px 14px; margin:12px 0; border-radius:4px;}
.warn { background:#fee2e2; border-left:4px solid #dc2626; padding:10px 14px; margin:12px 0; border-radius:4px;}
</style></head><body><div class="wrap">
<h1>Walk-Forward 滚动验证报告</h1>
<p class='muted'>来源: demo</p>
<div class='cards'><div class='card'><div class='k'>窗口数</div><div class='v'>3</div></div><div class='card'><div class='k'>WFE (ΣOOS净/ΣIS净)</div><div class='v pos'>+0.51</div></div><div class='card'><div class='k'>OOS 盈利窗口占比</div><div class='v'>0%</div></div><div class='card'><div class='k'>IS-OOS PF 相关性</div><div class='v'>-0.28</div></div></div><svg viewBox="0 0 760 260" class="chart"><line x1="46" y1="224.0" x2="744" y2="224.0" stroke="#e5e7eb" stroke-width="0.5"/><text x="40" y="227.0" font-size="9" fill="#6b7280" text-anchor="end">0.00</text><line x1="46" y1="174.0" x2="744" y2="174.0" stroke="#e5e7eb" stroke-width="0.5"/><text x="40" y="177.0" font-size="9" fill="#6b7280" text-anchor="end">0.25</text><line x1="46" y1="124.0" x2="744" y2="124.0" stroke="#e5e7eb" stroke-width="0.5"/><text x="40" y="127.0" font-size="9" fill="#6b7280" text-anchor="end">0.50</text><line x1="46" y1="74.0" x2="744" y2="74.0" stroke="#e5e7eb" stroke-width="0.5"/><text x="40" y="77.0" font-size="9" fill="#6b7280" text-anchor="end">0.75</text><line x1="46" y1="24.0" x2="744" y2="24.0" stroke="#e5e7eb" stroke-width="0.5"/><text x="40" y="27.0" font-size="9" fill="#6b7280" text-anchor="end">1.00</text><line x1="46" y1="24.0" x2="744" y2="24.0" stroke="#9ca3af" stroke-dasharray="3,3" stroke-width="0.8"/><polyline points="46.0,79.4 395.0,64.9 744.0,63.7" fill="none" stroke="#2563eb" stroke-width="1.6"><title></title></polyline><polyline points="46.0,66.6 395.0,60.7 744.0,79.2" fill="none" stroke="#dc2626" stroke-width="1.6"><title></title></polyline><text x="46.0" y="238.0" font-size="9" fill="#374151" text-anchor="middle">#0</text><text x="395.0" y="238.0" font-size="9" fill="#374151" text-anchor="middle">#1</text><text x="744.0" y="238.0" font-size="9" fill="#374151" text-anchor="middle">#2</text><text x="380" y="16" font-size="11" fill="#374151" text-anchor="middle">滚动窗口 IS vs OOS 盈利因子 (PF=1 为盈亏平衡线)</text><text x="744" y="32" font-size="10" fill="#2563eb" text-anchor="end">IS PF</text><text x="744" y="46" font-size="10" fill="#dc2626" text-anchor="end">OOS PF</text><text x="380" y="256" font-size="9" fill="#6b7280" text-anchor="middle">窗口序号 →</text></svg><table class='data'><thead><tr><th>窗口</th><th>IS区间</th><th>OOS区间</th><th>IS笔</th><th>IS净</th><th>IS PF</th><th>IS胜率</th><th>OOS笔</th><th>OOS净</th><th>OOS PF</th><th>OOS胜率</th><th>OOS回撤</th></tr></thead><tbody><tr><td>#0</td><td>2024-01-01~2024-03-01</td><td>2024-03-01~2024-03-31</td><td>480</td><td>-171.12</td><td>0.72</td><td>43.3%</td><td>240</td><td class='neg'>-63.73</td><td>0.79</td><td>45.0%</td><td>-103.50</td></tr><tr><td>#1</td><td>2024-01-31~2024-03-31</td><td>2024-03-31~2024-04-30</td><td>480</td><td>-122.89</td><td>0.80</td><td>45.0%</td><td>240</td><td class='neg'>-55.43</td><td>0.82</td><td>45.0%</td><td>-99.96</td></tr><tr><td>#2</td><td>2024-03-01~2024-04-30</td><td>2024-04-30~2024-05-30</td><td>480</td><td>-119.16</td><td>0.80</td><td>45.0%</td><td>240</td><td class='neg'>-91.91</td><td>0.72</td><td>41.7%</td><td>-120.94</td></tr></tbody></table><p class='muted'>IS 与 OOS 的 PF 相关性低 → IS 表现难以预测 OOS,参数不稳健,警惕过拟合单段行情。</p><div class='note'>WFE &gt; 0.5:OOS 能保留 IS 的一半以上盈利,泛化较好。</div>
</div></body></html>