6d0c0716fae13484a9c006002fb09eff0d2e5bb6
Root cause: MT5 actually reads live EA inputs from MQL5/Profiles/Charts/Default/chartNN.chr at boot, not from the .set presets -- and it never rewrites that file on container shutdown (files were found frozen at their Aug 6 mtimes through every restart since, including graceful ones with stop_grace_period). This is why the XAUUSD spread-filter fix (Jul 30) and the Monday A/B reversion (Aug 10) both kept reverting after restarts. sync-ea-inputs.sh (+ .py) runs on every container boot via custom-cont-init.d, before MT5 launches, and writes each chart's matching bo-*.set values directly into its .chr cache -- bypassing MT5's broken save-on-exit path entirely. Validated with a real corrupt-then-restart-then-verify cycle (see vault note). Deployed copy lives at ~/mt5-docker/custom-cont-init.d/ (mt5-docker is not a git repo); this is the tracked source, kept in sync with the deployed version by hand like the other scripts here (e.g. export-history.sh).
MQL Trading Bots Repository
Collection of MetaTrader 4/5 Expert Advisors and Indicators for automated forex trading.
🎯 Main Strategies
1. MultiSignal Confluence EA (PRIMARY)
Combines Pivot Points + Candlestick Patterns + Harmonic Patterns
Signal Strength:
- 1 signal = 0.75 (NO TRADE)
- 2 signals = 0.90 (TRADE)
- 3 signals = 1.00 (STRONG TRADE)
2. OrdersEA_Smart_Grid EA
Grid trading around daily pivot levels with RSI/ADX filters
📁 File Structure
mql-trading-bots/
├── MultiSignal_Confluence_EA.mq5 # PRIMARY EA - Confluence trading (v1.14)
├── OrdersEA_Smart_Grid.mq5 # Grid trading EA (v3.3)
├── MultiSignal_Confluence.mq5 # Indicator version
├── HarmonicPatternFinderV2_Optimized.mq5
├── CandlestickPatternEA_Fixed.mq5
├── FadePivot2_v4_Fixed.mq5
├── confluence-*.set # Settings for Confluence EA (11 pairs)
├── grid-*.set # Settings for Grid EA (14 pairs)
└── verify-short-signals.py # Verification script
📊 Performance
| Account | Period | Return | Win Rate | Status |
|---|---|---|---|---|
| 104125640 | March 2026 | ~15-19% | 46-87% | Active |
| 103477358 | February 2026 | ~4% | - | Closed |
Starting Balance: $100,000
Current Balance: ~$115,000+
Largest Win: $8,091
Largest Loss: -$805
⚙️ EA Versions
MultiSignal_Confluence_EA.mq5
| Version | Date | Changes |
|---|---|---|
| v1.14 | 2026-03-30 | Fixed short signal detection (removed restrictive belowPivot check) |
| v1.13 | 2026-03-29 | Added daily drawdown protection |
| v1.12 | 2026-03-21 | Added volatility/ADX filters |
| v1.11 | 2026-03-21 | Fixed stop loss cross-symbol contamination |
OrdersEA_Smart_Grid.mq5
| Version | Date | Changes |
|---|---|---|
| v3.3 | 2026-04-16 | Fixed GridHigh/GridLow to use ATR bands; relaxed filter defaults |
| v3.2 | 2026-04-01 | Added InpStopAfterProfit option |
| v3.1 | 2026-03-30 | Added weekend gap protection |
| v3.0 | 2026-03-29 | Fixed daily forced closure bug |
🚀 Deployment
MT5 Location
~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Experts/
Deployment Steps
- Copy
.mq5files to MT5MQL5/Experts/ - Compile in MetaEditor (F7)
- Attach to charts (H1 recommended)
- Load corresponding
.setfile for each pair
MT5 Docker
- Location:
~/mt5-docker/ - Config:
mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/ - Wine Version: 9.17 (DO NOT upgrade to 10.0+)
🔧 Key Features
Confluence EA Settings
InpMinConfluence = 2 // Min signals to trade
InpMinStrength = 0.90 // Min signal strength
InpUseVolatilityFilter = true // ATR filter
InpUseADXFilter = true // ADX filter
InpMaxDailyDrawdown = 3.0 // Daily loss limit %
Grid EA Settings
UseAutoPivots = true // Auto-calculate daily pivots
InpCloseBeforeWeekend = true // Close Friday before weekend
InpWeekendCloseHour = 17 // 5 PM broker time
MaxLevels = 10 // Grid levels
⚠️ Known Issues & Solutions
| Issue | Solution | Version |
|---|---|---|
| Stop loss cross-symbol contamination | Use _Symbol directly instead of CSymbolInfo |
v1.11 |
| Short signals not firing | Removed belowPivot restriction |
v1.14 |
| Weekend gap risk | Added Friday close option | v3.1 |
| Daily drawdown | Added CheckDailyDrawdown() protection |
v1.13/v3.0 |
📈 Recommended Pair Setups
Conservative (7 charts)
- USDJPY, EURJPY, EURUSD, AUDUSD, USDCAD (Confluence)
- EURCHF, EURUSD (Grid)
Aggressive (12 charts)
Add: GBPUSD, NZDUSD, USDCHF (Confluence) + GBPUSD, USDJPY (Grid)
Full Portfolio (15 charts)
Add: GBPJPY, XAUUSD (both EAs)
🔑 Important Notes
- Symbol-specific positions - EAs track positions per
_Symbol - Magic Number - Confluence: 777777, Grid: 333
- Only LONG trades - Confluence EA was biased long (v1.13), fixed in v1.14
- Weekend risk - Always enable
InpCloseBeforeWeekend=true - Daily DD - Set
InpMaxDailyDrawdown=3.0to limit losses
📂 Conversation History
See ~/conversation-history/ directory for session notes:
2026-03-21-mql-trading-bots.md- Initial verification & migration2026-03-29-session-save.md- Settings library & bug fixes2026-03-30-weekend-gap-short-signal-fix.md- Weekend protection & short signal fix2026-04-07-confluence-ea-diagnosis.md- ATR/ADX filter root cause analysis2026-04-13-new-account-grid-issue.md- New account & Grid EA filters
🔗 Links
- Gitea: https://git.fetcherpay.com/garfield/mql-trading-bots
- MT5 Reports:
~/mt5-docker/config/.wine/drive_c/users/abc/Desktop/ReportHistory-*.html
Last Updated: 2026-03-30
Languages
MQL5
86.5%
Python
5.8%
MQL4
5.5%
Shell
2.2%