diff --git a/README.md b/README.md index c38e9d9..e3f13cf 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ Claude: [compile → clean → backtest → analyze 1,847 deals] |---|---|---| | **Platform** | macOS/Linux native | Windows only | | **Backtest pipeline** | ✅ Full (compile → run → analyze) | ✅ Via MT5 Python package | -| **Deal-level analytics** | ✅ 15+ dimensions | ❌ | -| **Report organization** | ✅ SQLite + search + history | ❌ | +| **Deal-level analytics** | ✅ 19 dimensions, DB-backed | ❌ | +| **Report organization** | ✅ SQLite (reports + deals) + search + history | ❌ | | **MQL5 compilation** | ✅ Headless (MetaEditor via Wine, no GUI) | ⚠️ Via GUI or terminal | | **Optimization** | ✅ Background + results parsing + .set generation | ⚠️ Terminal only, no parsing | | **Crash debugging** | ✅ Wine/MT5 diagnostics | ❌ | diff --git a/docs/MCP_TOOLS.md b/docs/MCP_TOOLS.md index 4031db5..2777a83 100644 --- a/docs/MCP_TOOLS.md +++ b/docs/MCP_TOOLS.md @@ -2629,7 +2629,7 @@ Get Wine prefix details: Windows version, installed programs, registry. ## `get_backtest_crash_info` -Investigate backtest failures: incomplete markers, missing deals.csv, errors. +Investigate backtest failures: incomplete markers, missing metrics.json, Wine/MT5 errors. **When to call:** When a backtest fails unexpectedly. @@ -3057,6 +3057,55 @@ Find comparable reports (same EA/symbol/timeframe). --- +## `export_deals_csv` + +Export deals for a report to a CSV file on demand. Deals are stored in the database — use this when you need a CSV file for external tools (Excel, pandas, etc.). + +**When to call:** When you need a `deals.csv` file. CSV is not written automatically after backtests anymore. + +### Input schema + +```typescript +{ + report_id?: string; // Report ID to export (default: latest report) + output_path?: string; // File path for CSV output (default: /deals.csv) +} +``` + +### Output schema + +```typescript +{ + success: boolean; + report_id: string; + deals_count: number; + output_path: string; // Absolute path to the written CSV file +} +``` + +### Example + +```json +// Input — export latest report to default path +{} + +// Input — export specific report to custom path +{ + "report_id": "20260422_051041_DPS21_XAUUSDc_M5_1", + "output_path": "/tmp/dps21_deals.csv" +} + +// Output +{ + "success": true, + "report_id": "20260422_051041_DPS21_XAUUSDc_M5_1", + "deals_count": 891, + "output_path": "/Users/…/reports/20260422_051041_DPS21_XAUUSDc_M5_1/deals.csv" +} +``` + +--- + ## Granular Analytics — Common Input Pattern All granular analytics tools below (`analyze_monthly_pnl` through `analyze_efficiency`, plus `list_deals` and `search_deals_*`) share the same report resolution logic: