Files
mql-trading-bots/UTILS.md
T
garfield 0894d18db4 WIP: 6+ weeks of uncommitted EA development and preset tuning
Confluence EA (v1.16 → v1.20):
- Per-EA realized P&L tracking via history deals
- Weekly drawdown protection
- Warmup bars, pivot cache, state persistence
- Point-scaled pivot thresholds, ranging ATR factor
- Market filling mode helper per symbol

Grid EA (v3.1 → v4.1):
- Adaptive filters, adaptive entry, spread filter
- Session filter, breakeven, correlation caps, range drift
- Profit protection (stop-after-profit, cycle reports)
- Edge cleanup v5.0 — close wrong-side positions outside grid
- Master one-shot shutdown, grid state persistence

Presets:
- Fix GetOut=Y shutdown bug on 4 grid presets
- Relax ADXMax 18→40, widen RSI 20/80 across grid presets
- Standardize daily drawdown 3%→5%, add weekly 10%
- Increase grid lots 0.01→0.03
- Normalize confluence ATR thresholds per pair
- Add XAGUSD, EURCHF, EURGBP, AUDNZD presets

Docs & DevOps:
- April 23 audit files (preset mismatch, code review, checklist)
- n8n workflow and validation infrastructure updates
- AI agent analyses in notes/

Known issues carried forward:
- Shared drawdown budget contamination (both EAs)
- Confluence ranging-market threshold inversion
- Older grid presets missing v4.1 safety controls
2026-05-12 09:02:25 -04:00

94 lines
2.2 KiB
Markdown
Executable File

# MT5 Helper Utilities
This directory contains helper scripts for managing MT5 trading and extracting data safely.
## Scripts
### view-report.sh
View MT5 HTML trading reports without browser (prevents VM crash).
```bash
./view-report.sh /path/to/ReportHistory-XXXX.html
```
### parse-deals.py
Parse MT5 binary deal files to extract trading data.
```bash
python3 parse-deals.py
```
Output: Account summary with P&L, trade counts, win/loss stats.
### export-history.sh
Guide for safely exporting trade history from MT5.
```bash
./export-history.sh
```
## Why These Are Needed
MT5 in Wine/VM crashes when generating reports because:
1. MT5 tries to open HTML in default browser
2. No browser installed in Wine environment
3. Browser launch fails → VM crash
These scripts work around that limitation.
## Report File Locations
### Binary Data (Internal)
```
~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/Bases/
├── MetaQuotes-Demo/trades/104125640/deals_2026.03.dat
├── MetaQuotes-Demo/trades/103477358/deals_2026.02.dat
└── ...
```
### HTML Reports (User Generated)
```
~/mt5-docker/config/.wine/drive_c/users/abc/Desktop/ReportHistory-XXXX.html
```
### Text Logs
```
~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Logs/YYYYMMDD.log
~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/logs/YYYYMMDD.log
```
## show-latest-report.sh
Automatically finds and displays the latest MT5 trading report.
```bash
./show-latest-report.sh # Show latest report
./show-latest-report.sh --save # Save to text file
```
**Features:**
- Automatically finds the most recent `ReportHistory-*.html` file
- Displays formatted summary with colors
- Shows account info, P&L, trade stats, and performance assessment
- No browser needed (prevents VM crash)
## parse-report.py
Python parser for MT5 HTML reports (used by show-latest-report.sh).
```bash
python3 parse-report.py # Auto-find latest
python3 parse-report.py /path/to/file.html # Parse specific file
```
**Output includes:**
- Account name and company
- Net profit, gross profit/loss
- Profit factor
- Total trades, win/loss count
- Win rate percentage
- Largest win/loss
- Balance and return calculation
- Performance assessment