Files
mymt5opp/scripts/check_report_inputs.py
gavindiaz 63a829cc46 phase 7-8 完成 + warmup 修复 + 产物结构化重组
主要内容:
- Phase 8 PROMOTE: finalist #1 (trial #324) registry 条目,自动生成
- Optuna objective warmup bug 修复 (shared/optimizer/objective.py)
- studies/ 目录按用途重组为 optuna/ + finalists/ + features/ 三层
- reports/ 加入 Optuna 中文 dashboard (5 主图 + 18 slice + 15 contour)
- 新增 PROJECT_GUIDE.md 项目说明文档
- 新增 build_registry_entry.py / build_optuna_dashboard.py / build_feature_datasets.py
- .gitignore: 允许提交 studies/*.db (Optuna DB) 和 reports/*.html (MT5 + dashboard)
2026-06-27 00:28:07 +08:00

35 lines
1.3 KiB
Python

"""Check what input parameters MT5 actually used in the report."""
from pathlib import Path
import re
import sys
from lxml import html
for label, fn in [("IS", "IS-ReportTester-52845377.html"), ("OOS", "OOS-ReportTester-52845377.html")]:
p = Path("reports") / fn
raw = p.read_bytes()
text = raw.decode("utf-16") if raw[:2] in (b"\xff\xfe", b"\xfe\xff") else raw.decode("utf-8", errors="replace")
tree = html.fromstring(text)
print(f"=== {label} report: Inputs section ===")
full_text = tree.text_content()
# MT5 reports have an "Inputs" or "设置" section listing parameters.
for marker in ("Inputs", "设置", "参数", "Input parameters"):
idx = full_text.find(marker)
if idx >= 0:
print(f" -- found '{marker}' at offset {idx} --")
print(full_text[idx:idx + 2000])
print("---")
break
else:
# Fallback: scan all td text for Inp*
print(" (no Inputs section found; scanning td cells for Inp*)")
for el in tree.iter("td"):
txt = (el.text_content() or "").strip()
if txt.startswith("Inp"):
# Get next sibling td
nxt = el.getnext()
if nxt is not None:
print(f" {txt} = {nxt.text_content().strip()}")
print()