Add comprehensive documentation for AI handoff

- AGENTS.md: Technical context for AI assistants
- QUICKREF.md: Quick reference card
- README.md: Updated with version history and performance
- conversation-history/README.md: Updated session index
- 2026-03-30-weekend-gap-short-signal-fix.md: Session notes
This commit is contained in:
2026-03-30 00:22:17 -04:00
parent 24f3d09c96
commit baaac18b84
3 changed files with 339 additions and 62 deletions

197
README.md
View File

@@ -2,89 +2,162 @@
Collection of MetaTrader 4/5 Expert Advisors and Indicators for automated forex trading.
## 🎯 Main Strategy: MultiSignal Confluence
## 🎯 Main Strategies
The flagship system combines three proven strategies for high-probability trades:
1. **Pivot Point Trading** - Support/Resistance levels
2. **Harmonic Pattern Recognition** - AB=CD, Gartley patterns
3. **Candlestick Pattern Analysis** - Hammers, Engulfing, etc.
### Confluence Logic
```
When 2+ signals align = HIGH PROBABILITY TRADE
### 1. MultiSignal Confluence EA (PRIMARY)
Combines Pivot Points + Candlestick Patterns + Harmonic Patterns
```cpp
Signal Strength:
- 1 signal = 0.75 (NO TRADE)
- 2 signals = 0.90 (TRADE)
- 3 signals = 1.00 (STRONG TRADE)
```
## 📁 Files
### 2. OrdersEA_Smart_Grid EA
Grid trading around daily pivot levels with RSI/ADX filters
### Primary EAs
| File | Description | Status |
|------|-------------|--------|
| `MultiSignal_Confluence_EA.mq5` | Main confluence trading EA | ✅ Active |
| `MultiSignal_Confluence.mq5` | Indicator version | ✅ Active |
---
### Component Systems
| File | Description |
|------|-------------|
| `HarmonicPatternFinderV2_Optimized.mq5` | Optimized harmonic pattern detection |
| `CandlestickPatternEA_Fixed.mq5` | Candlestick pattern trading (fixed) |
| `FadePivot2_v4_Fixed.mq5` | Pivot fade strategy (fixed) |
## 📁 File Structure
### Bot Series
| File | Description |
|------|-------------|
| `Bot10001.mq5` | Bot series v1 |
| `Bot10002.mq5` | Bot series v2 |
| `EnhancedEA.mq5` | Enhanced features EA |
```
mql-trading-bots/
├── MultiSignal_Confluence_EA.mq5 # PRIMARY EA - Confluence trading (v1.14)
├── OrdersEA_Smart_Grid.mq5 # Grid trading EA (v3.1)
├── 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 104125640 (March 2026)**
- Starting Balance: $100,000
- Net Profit: ~$15,000 (15%)
- Win Rate: 46%
- Largest Win: $8,091
- Largest Loss: -$805
## 📊 Performance
**Account 103477358 (February 2026)**
- Net Profit: ~$4,155 (4%)
| Account | Period | Return | Win Rate | Status |
|---------|--------|--------|----------|--------|
| 104125640 | March 2026 | ~15-19% | 46-87% | Active |
| 103477358 | February 2026 | ~4% | - | Closed |
## ⚙️ Settings
**Starting Balance:** $100,000
**Current Balance:** ~$115,000+
**Largest Win:** $8,091
**Largest Loss:** -$805
### Risk Management
- Lot Size: 0.01 (1% risk per trade)
- Stop Loss: 100 points
- Take Profit: 200 points
- Max Positions: 3 per symbol
---
### Confluence Settings
- Min Confluence: 2/3 signals
- Min Strength: 0.90
- Require Agreement: Yes (no conflicting signals)
## ⚙️ 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.1 | 2026-03-30 | Added weekend gap protection |
| v3.0 | 2026-03-29 | Fixed daily forced closure bug |
---
## 🚀 Deployment
1. Copy EA files to `MQL5/Experts/`
2. Copy Indicator files to `MQL5/Indicators/`
3. Compile in MetaEditor
4. Attach to charts (H1 recommended)
### MT5 Location
```
~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Experts/
```
## 📝 Notes
### Deployment Steps
1. Copy `.mq5` files to MT5 `MQL5/Experts/`
2. Compile in MetaEditor (F7)
3. Attach to charts (H1 recommended)
4. Load corresponding `.set` file for each pair
- EAs run on MT5 via Wine on Ubuntu server
- Docker container: `mt5-docker`
- Gitea backup ensures code is preserved
## 🔧 Version History
- **v1.11** - Fixed stop loss bug (cross-symbol contamination)
- **v1.10** - Initial stable release
- **v1.00** - First profitable version
### 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+)
---
*Last Updated: March 2026*
## 🔧 Key Features
### Confluence EA Settings
```cpp
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
```cpp
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
1. **Symbol-specific positions** - EAs track positions per `_Symbol`
2. **Magic Number** - Confluence: 777777, Grid: 333
3. **Only LONG trades** - Confluence EA was biased long (v1.13), fixed in v1.14
4. **Weekend risk** - Always enable `InpCloseBeforeWeekend=true`
5. **Daily DD** - Set `InpMaxDailyDrawdown=3.0` to limit losses
---
## 📂 Conversation History
See `conversation-history/` directory for session notes:
- `2026-03-21-mql-trading-bots.md` - Initial verification & migration
- `2026-03-29-session-save.md` - Settings library & bug fixes
- `2026-03-30-weekend-gap-short-signal-fix.md` - Weekend protection & short signal fix
---
## 🔗 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*