From 4c34ae236cb7b794010bfc00b29fdd1340f85917 Mon Sep 17 00:00:00 2001 From: Devid HW Date: Sat, 25 Apr 2026 09:11:37 +0700 Subject: [PATCH] docs: update CHANGELOG, TROUBLESHOOTING, MCP_TOOLS for v1.32.4 - CHANGELOG: add v1.32.4 entry with all fixes and verification results - TROUBLESHOOTING: add Wine/macOS HTML report section (ShutdownTerminal=1 does not exit terminal64.exe; inactivity kill + 30s HTML wait workaround) - TROUBLESHOOTING: add list_deals 0 results section (binary restart required) - MCP_TOOLS: add shutdown and inactivity_kill_secs params to launch_backtest schema (were implemented but undocumented) Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ docs/MCP_TOOLS.md | 12 ++++++++---- docs/TROUBLESHOOTING.md | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c74ead5..ac3309e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## [1.32.4] — 2026-04-25 + +### Fixed +- **HTML report extraction**: `ShutdownTerminal=1` does not cause `terminal64.exe` to exit on Wine/macOS. + Inactivity watchdog now waits 30 s for the report file after the tester log goes quiet, then kills + MT5 unconditionally — no longer depends on natural process exit. +- **Duplicate deals**: tester agent log writes each deal twice; deduplicated via `HashSet` + in `parse_journal_deals`. +- **Entry direction inference**: all journal deals were marked `entry="in"` because no direction info + exists in the log. Fixed with a per-symbol position tracker (signed lot accumulation) to infer + "in" / "out" correctly. +- **`list_deals` returning 0 results**: `is_closed_trade()` was gating on `profit != 0.0`; journal + deals legitimately have zero profit. Removed the profit gate. +- **Wrong tester log selected**: `Agent-0.0.0.0` logs only contain startup lines, not deal lines. + `find_active_tester_agent_log` now prefers `Agent-127.0.0.1` and tiebreaks by file size. + +### Added +- `launch_backtest` exposes `shutdown` (default `true`) and `inactivity_kill_secs` (default `120`) + as explicit tool parameters. +- Report DB stores deals in SQLite; all analytics tools resolve by `report_id` / `report_dir` / latest. + +### Verified +- 1-month DPS21/XAUUSD.cent/M5 backtest produces full HTML report: win_rate=70%, + profit_factor=0.77, sharpe=-3.61, max_dd=6.93%. All 17 analytics tools return real data. + + ## [1.31.5] — 2026-04-22 - feat: add check_update and update tools with background auto-check diff --git a/docs/MCP_TOOLS.md b/docs/MCP_TOOLS.md index 2777a83..e7c7809 100644 --- a/docs/MCP_TOOLS.md +++ b/docs/MCP_TOOLS.md @@ -185,10 +185,14 @@ Fire-and-forget mode: compile → clean → launch MT5 backtest, return immediat deposit?: number; // Initial deposit (default: 10000) model?: 0 | 1 | 2; // Tick model (default: 0) set_file?: string; // Path to .set parameter file - skip_compile?: boolean; // Skip compilation - skip_clean?: boolean; // Skip cache cleaning - timeout?: number; // Max time in seconds (default: 900) - gui?: boolean; // Enable MT5 visualization + skip_compile?: boolean; // Skip compilation + skip_clean?: boolean; // Skip cache cleaning + timeout?: number; // Max time in seconds (default: 900) + gui?: boolean; // Enable MT5 visualization + shutdown?: boolean; // Shut down MT5 after test (default: true) + inactivity_kill_secs?: number; // Kill MT5 if tester log silent for N seconds (default: 120). + // After silence, pipeline waits 30s for HTML then kills MT5. + // Set to 0 to disable. Useful to abort stalled EAs. } ``` diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md index c0f9a5d..1d03089 100644 --- a/docs/TROUBLESHOOTING.md +++ b/docs/TROUBLESHOOTING.md @@ -69,6 +69,41 @@ Set `MT5_MCP_HOME` or ensure config exists at: 4. **Date range has no trades** — try wider range or confirm symbol was active. +## Backtest Completes But Always Shows "journal-only" (No HTML Report) + +**Symptom:** Every backtest produces `status: completed_no_html` and all deal profits are `0.0`. + +**Cause:** On Wine/macOS, `ShutdownTerminal=1` does **not** cause `terminal64.exe` to exit after the +test completes. The tester agent (MetaTester 5) closes normally, but the terminal process stays alive +indefinitely. Without process exit, MT5 never writes the HTML report. + +**How the pipeline handles this:** The inactivity watchdog detects that the tester log has stopped +growing (test done), waits 30 seconds polling for the HTML file, then kills `terminal64.exe` +unconditionally. If the HTML appears during the wait it is extracted; otherwise journal extraction +provides deal counts and final balance (but no per-deal P&L). + +**To maximise HTML report chances:** Use `inactivity_kill_secs=120` (default) with `shutdown=true` +(default). This gives MT5 120s of quiet time + 30s of HTML-wait before the kill. + +``` +launch_backtest(expert: "MyEA", shutdown: true, inactivity_kill_secs: 120) +``` + +**Fallback data available from journal:** +- Deal count, volume, prices, timestamps ✓ +- Final balance (pips) ✓ +- Per-deal profit/loss ✗ (always 0.0) +- Win rate, profit factor, Sharpe, drawdown ✗ (require HTML) + +## `list_deals` Returns 0 Filtered Results + +Analytics tools filter deals with `is_closed_trade()` which checks `entry = "out"`. If all deals +show `entry = "in"`, the position tracker that infers direction from signed lot accumulation may +not have run (old binary in memory). + +**Fix:** Restart the MCP server (restart Claude Code / your IDE) after installing a new binary. +The server process caches the binary in memory — `install` doesn't hot-reload it. + ## MetaEditor Compile Errors Check `/MQL5/Logs/`: