3.9 KiB
Session: 2026-04-01 - MT5 Trading Analysis & EA Fixes
Participants
- User: Garfield (garfield@fetcherpay.com)
- AI: opencode
Session Overview
Analyzed MT5 trading logs, identified critical bugs and misconfigurations, and applied fixes to both the Confluence EA and the Grid EA.
1. Trading Activity Summary
- Account: 104125640 — MetaQuotes-Demo, Hedging
- March P&L: ~+$541,735.64 (1,199 deals) — heavy demo activity
- Apr 1 Activity: 106 deals (much quieter than Mar 31)
- Current Open Positions: 45 positions
- Primary EAs:
MultiSignal_Confluence_EA v1.18+OrdersEA_Smart_Grid v3.2
Confluence EA Status
- Effectively dormant over the last 2 days.
- Blocked by: low signal strength (23x) and ATR/volatility filters (7x).
- Filters are working as designed — avoiding choppy markets.
Grid EA Status
- Active on NZDUSD, GBPJPY, USDCAD, GBPUSD.
- Identified a critical order clustering bug causing multiple stop orders to stack within 1 pip.
2. Critical Fixes Applied
A. Grid Clustering Bug — FIXED & RECOMPILED
File: ~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Experts/OrdersEA_Smart_Grid.mq5
Problem: When a calculated grid level was too close to current price, the EA clamped it to the minimum allowed distance. This caused multiple buy/sell stops to pile up at the same price.
Fix: Changed PlaceBuyStop() and PlaceSellStop() to skip (return false) levels that are too close, rather than clamping them.
Status: ✅ Recompiled successfully (.ex5 updated).
B. Desktop .set Files — FIXED
Files: ~/Desktop/confluence*.set
Problem: These files used old parameter names from a previous EA version (InpMinConfluenceStrength, InpMaxSignalAge, InpUseATRFilter, InpAvoidWeekends, etc.). MT5 silently ignored them, so charts were running on defaults.
Fix: Rewrote all Desktop confluence .set files with correct v1.18 parameter names, then synced them with the optimized MQL5/Presets/ versions.
C. Unique Magic Numbers — ENSURED
- Confluence presets: Each pair now has a unique magic number (e.g.,
777772for EURUSD,777780for GBPJPY).confluence-audusd.setwas kept at777777to avoid orphaning live trades. - Grid presets: Already unique (
333001–333014). Desktop grid.setfiles were synced to match.
D. New Feature: InpStopAfterProfit — ADDED
File: OrdersEA_Smart_Grid.mq5
What it does: When enabled (InpStopAfterProfit=true), the Grid EA stops placing new grids for the rest of the day after a profitable cycle (all positions close with equity higher than the cycle start).
Reset: Automatically clears at broker time hour 00:00.
Parameter added to all grid .set files (default false).
3. Files Modified
Source Code
~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Experts/OrdersEA_Smart_Grid.mq5~/mt5-docker/source-files/OrdersEA_Smart_Grid.mq5
Compiled Binary
~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Experts/OrdersEA_Smart_Grid.ex5
Presets (MQL5 & Desktop)
- All
confluence-*.setfiles (parameter names + magic numbers) - All
grid-*.setfiles (magic numbers +InpStopAfterProfit)
Infrastructure
~/devops/INFRASTRUCTURE.md— Addeddoc.fetcherpay.comandwww.fetcherpay.comto DNS whitelist~/fetcherpay-docs/k8s/docs-deployment.yaml— Addeddoc.fetcherpay.comto ingress~/fetcherpay-k8s/fetcherpay-complete.yaml— Fixed truncated ingress section
4. Action Items for User
- Reload
.setfiles on all MT5 charts (Properties → Load → select preset). - Remove and re-attach
OrdersEA_Smart_Gridto pick up the recompiled binary with fixes. - Restart MT5 after reloading to ensure clean state.
- Optionally enable
InpStopAfterProfit=trueon grid charts if you want one profitable cycle per day.