添加后缀映射功能
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# Verify the two backtest reports.
|
||||
import os, re
|
||||
|
||||
TARGET = r"C:\Users\Administrator\Desktop\mt5-backtest\reports"
|
||||
reports = sorted([f for f in os.listdir(TARGET) if f.startswith('MACD_MA_XAUUSD_5M_') and f.endswith('.htm')])
|
||||
|
||||
print(f"Found {len(reports)} candidate reports:")
|
||||
for r in reports:
|
||||
p = os.path.join(TARGET, r)
|
||||
size = os.path.getsize(p)
|
||||
text = open(p, encoding='utf-8', errors='ignore').read()
|
||||
m = re.search(r'交易品种:</td>\s*<td[^>]*><b>([^<]+)</b>', text)
|
||||
sym = m.group(1) if m else "(not found)"
|
||||
has_xauusd = 'XAUUSD' in text
|
||||
has_xauusdc = 'XAUUSDc' in text
|
||||
print(f" {r} size={size} symbol_in_report={sym} contains_XAUUSD={has_xauusd} contains_XAUUSDc={has_xauusdc}")
|
||||
Reference in New Issue
Block a user