Update conversation history and add recent notes
This commit is contained in:
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
.idea/.gitignore
generated
vendored
Normal file → Executable file
0
.idea/.gitignore
generated
vendored
Normal file → Executable file
0
.idea/conversation-history.iml
generated
Normal file → Executable file
0
.idea/conversation-history.iml
generated
Normal file → Executable file
0
.idea/misc.xml
generated
Normal file → Executable file
0
.idea/misc.xml
generated
Normal file → Executable file
0
.idea/modules.xml
generated
Normal file → Executable file
0
.idea/modules.xml
generated
Normal file → Executable file
0
.idea/vcs.xml
generated
Normal file → Executable file
0
.idea/vcs.xml
generated
Normal file → Executable file
0
2026-03-21-mql-trading-bots.md
Normal file → Executable file
0
2026-03-21-mql-trading-bots.md
Normal file → Executable file
0
2026-03-21-mql-trading-report-analysis.md
Normal file → Executable file
0
2026-03-21-mql-trading-report-analysis.md
Normal file → Executable file
16
2026-03-30-dns-whitelist.md
Executable file
16
2026-03-30-dns-whitelist.md
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
# DNS Whitelist for Firewall
|
||||||
|
|
||||||
|
**Date:** 2026-03-30
|
||||||
|
|
||||||
|
## IP Addresses to whitelist
|
||||||
|
|
||||||
|
| Domain | IP Address |
|
||||||
|
|--------|-------------|
|
||||||
|
| chat.fetcherpay.com | 23.120.207.35 |
|
||||||
|
| git.fetcherpay.com | 23.120.207.35 |
|
||||||
|
|
||||||
|
Both domains resolve to the same IP: **23.120.207.35**
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- Internal Gitea also available at: `10.152.183.192:3000` (Ubuntu server only, not for firewall whitelist)
|
||||||
138
2026-03-30-weekend-gap-short-signal-fix.md
Executable file
138
2026-03-30-weekend-gap-short-signal-fix.md
Executable file
@@ -0,0 +1,138 @@
|
|||||||
|
# Session: 2026-03-30 - Weekend Gap Fix & Short Signal Fix
|
||||||
|
|
||||||
|
## Participants
|
||||||
|
- **User**: Garfield (garfield@fetcherpay.com)
|
||||||
|
- **AI**: OpenCode CLI
|
||||||
|
|
||||||
|
## Session Overview
|
||||||
|
Fixed two known issues from previous session:
|
||||||
|
1. Weekend gap risk on Grid EA
|
||||||
|
2. Short signal detection on Confluence EA
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Weekend Gap Risk Fix (Grid EA v3.1)
|
||||||
|
|
||||||
|
### Problem
|
||||||
|
Positions held over weekend can gap 100-500+ pips on Sunday/Monday open, causing massive losses.
|
||||||
|
|
||||||
|
### Solution Implemented
|
||||||
|
Added Friday position close feature:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
//--- Weekend Protection
|
||||||
|
input bool InpCloseBeforeWeekend = true; // Enable Friday close
|
||||||
|
input int InpWeekendCloseHour = 17; // Close at 5 PM broker time
|
||||||
|
input bool InpCancelPendingBeforeWeekend = true; // Cancel pending orders too
|
||||||
|
```
|
||||||
|
|
||||||
|
New `CheckWeekendProtection()` function closes all positions Friday before weekend.
|
||||||
|
|
||||||
|
### Files Modified
|
||||||
|
- `OrdersEA_Smart_Grid.mq5` - Added weekend protection (v3.1)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Short Signal Detection Fix (Confluence EA v1.14)
|
||||||
|
|
||||||
|
### Problem
|
||||||
|
EA was generating almost zero SHORT (SELL) trades. Historical data showed 0 shorts.
|
||||||
|
|
||||||
|
### Root Cause
|
||||||
|
Restrictive `belowPivot = close < p` check was blocking all short signals when price was above pivot point.
|
||||||
|
|
||||||
|
### Fix Applied
|
||||||
|
Removed asymmetric restriction - SELL logic now mirrors BUY logic:
|
||||||
|
|
||||||
|
**Before:**
|
||||||
|
```cpp
|
||||||
|
if(nearResistance || (rejectedFromResistance && belowPivot)) // ❌ Too restrictive
|
||||||
|
```
|
||||||
|
|
||||||
|
**After:**
|
||||||
|
```cpp
|
||||||
|
if(nearResistance || rejectedFromResistance) // ✅ Mirrors BUY
|
||||||
|
```
|
||||||
|
|
||||||
|
Also relaxed harmonic pattern tolerances from `0.5-0.8` to `0.3-1.3`.
|
||||||
|
|
||||||
|
### Files Modified
|
||||||
|
- `MultiSignal_Confluence_EA.mq5` - Fixed short signal detection (v1.14)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Compilation Errors Fixed
|
||||||
|
|
||||||
|
### Error 1: Missing #include
|
||||||
|
```
|
||||||
|
#include <Trade\Trade.mqh>
|
||||||
|
#include <Trade\PositionInfo.mqh>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Error 2: Undeclared identifiers
|
||||||
|
- `abovePivot` / `belowPivot` - removed from debug print
|
||||||
|
- `gridPlaced` - moved to global scope
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Verification
|
||||||
|
|
||||||
|
### Short Signal Verification Script
|
||||||
|
Created `verify-short-signals.py` to validate short signal logic.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 verify-short-signals.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Results: All checks passed ✅
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. File Deployment
|
||||||
|
|
||||||
|
### Files Copied to MT5
|
||||||
|
```
|
||||||
|
~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Experts/
|
||||||
|
├── MultiSignal_Confluence_EA.mq5 (v1.14)
|
||||||
|
└── OrdersEA_Smart_Grid.mq5 (v3.1)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Next Step
|
||||||
|
- Recompile in MT5 MetaEditor (F7)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Git Commits
|
||||||
|
|
||||||
|
| Commit | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
| `d071b3c` | Fix weekend gap risk and short signal detection |
|
||||||
|
| `c53dff6` | (amend) Restore missing #include statements |
|
||||||
|
| `028a41b` | Fix: remove abovePivot/belowPivot debug references |
|
||||||
|
| `24f3d09` | Fix: make gridPlaced global for CheckWeekendProtection |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Settings Files
|
||||||
|
|
||||||
|
Existing `.set` files work without modification - new parameters use sensible defaults:
|
||||||
|
- `InpCloseBeforeWeekend = true`
|
||||||
|
- `InpWeekendCloseHour = 17`
|
||||||
|
- `InpCancelPendingBeforeWeekend = true`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Next Steps
|
||||||
|
|
||||||
|
1. **Test in MT5** - Load both EAs on demo account
|
||||||
|
2. **Monitor** - Watch for SELL signals on Confluence EA
|
||||||
|
3. **Verify weekend close** - Check Grid EA closes Friday at 5 PM
|
||||||
|
4. **Push to Gitea** - Run `git push`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Session Status: ✅ COMPLETE
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Session recorded: 2026-03-30*
|
||||||
55
2026-03-31-confluence-settings-update.md
Executable file
55
2026-03-31-confluence-settings-update.md
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
# 2026-03-31 - Confluence EA Settings Update
|
||||||
|
|
||||||
|
## Date: March 31, 2026
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
Applied updated Confluence EA settings to all 10 MT5 charts. Verified settings via logs.
|
||||||
|
|
||||||
|
## Actions
|
||||||
|
|
||||||
|
### 1. Checked Local .set Files
|
||||||
|
Reviewed all confluence-*.set files in `/home/garfield/mql-trading-bots/`:
|
||||||
|
- standard, aggressive, relaxed (base profiles)
|
||||||
|
- eurusd, gbpjpy, gbpusd, audusd, usdjpy, eurjpy, usdcad, usdchf, nzdusd, xauusd (pair-specific)
|
||||||
|
|
||||||
|
### 2. Found MT5 Wine Presets
|
||||||
|
Located in: `~/mt5-docker/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Presets/`
|
||||||
|
|
||||||
|
### 3. Applied Settings to Running EAs
|
||||||
|
User applied sets one by one, verified via log output:
|
||||||
|
|
||||||
|
| Pair | Magic | Min Strength | Status |
|
||||||
|
|------|-------|--------------|--------|
|
||||||
|
| EURUSD | 777772 | 0.70 | ✓ |
|
||||||
|
| GBPJPY | 777780 | 0.75 | ✓ (fixed after reapply) |
|
||||||
|
| AUDUSD | 777777 | 0.71 | ✓ |
|
||||||
|
| GBPUSD | 777773 | 0.80 | ✓ |
|
||||||
|
| USDJPY | 777771 | 0.70 | ✓ |
|
||||||
|
| EURJPY | 777775 | 0.72 | ✓ |
|
||||||
|
| USDCAD | 777776 | 0.73 | ✓ |
|
||||||
|
| USDCHF | 777779 | 0.75 | ✓ |
|
||||||
|
| NZDUSD | 777778 | 0.72 | ✓ |
|
||||||
|
| XAUUSD | 777774 | 0.75 | ✓ |
|
||||||
|
|
||||||
|
### 4. Risk Calculation Discovery
|
||||||
|
**Issue Found:** Both EAs (Confluence + Smart Grid) share the same daily drawdown limit.
|
||||||
|
|
||||||
|
**Code Analysis:**
|
||||||
|
- `MultiSignal_Confluence_EA.mq5` lines 648-689: Daily drawdown uses `AccountInfoDouble(ACCOUNT_EQUITY)`
|
||||||
|
- Both EAs check same account equity, so they share the 3% daily limit
|
||||||
|
- Position counting IS correct (filters by symbol + magic number)
|
||||||
|
|
||||||
|
**Implication:** If Smart Grid EA loses 2%, Confluence EA only has 1% remaining.
|
||||||
|
|
||||||
|
## Decisions Pending
|
||||||
|
User is thinking about how to handle shared daily drawdown risk:
|
||||||
|
1. Lower Grid EA risk
|
||||||
|
2. Increase total daily drawdown (e.g., 5%)
|
||||||
|
3. Separate tracking per EA
|
||||||
|
|
||||||
|
## Files Modified
|
||||||
|
- All confluence-*.set files synced to MT5 Presets directory
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
- Wait for user decision on risk management approach
|
||||||
|
- Potentially adjust Grid EA settings
|
||||||
87
INFRASTRUCTURE.md
Executable file
87
INFRASTRUCTURE.md
Executable file
@@ -0,0 +1,87 @@
|
|||||||
|
# Infrastructure Overview
|
||||||
|
|
||||||
|
**Date:** 2026-03-30
|
||||||
|
|
||||||
|
## Server
|
||||||
|
|
||||||
|
- **Public IP:** 23.120.207.35
|
||||||
|
- **Hostname:** (check with `hostname`)
|
||||||
|
- **Operating System:** Ubuntu (likely 22.04 LTS)
|
||||||
|
|
||||||
|
## Network
|
||||||
|
|
||||||
|
| Network | Subnet |
|
||||||
|
|---------|--------|
|
||||||
|
| Primary | 23.120.207.35/22 |
|
||||||
|
| Docker bridge | 172.17.0.1/16 |
|
||||||
|
| Docker secondary | 172.18.0.1/16 |
|
||||||
|
| Docker tertiary | 172.19.0.1/16 |
|
||||||
|
| Docker quaternary | 172.20.0.1/16 |
|
||||||
|
| MicroK8s | 10.1.58.192/32 |
|
||||||
|
|
||||||
|
## DNS Whitelist (Firewall)
|
||||||
|
|
||||||
|
| Domain | IP Address |
|
||||||
|
|--------|-------------|
|
||||||
|
| chat.fetcherpay.com | 23.120.207.35 |
|
||||||
|
| git.fetcherpay.com | 23.120.207.35 |
|
||||||
|
| (internal Gitea) | 10.152.183.192:3000 |
|
||||||
|
|
||||||
|
## Kubernetes (MicroK8s)
|
||||||
|
|
||||||
|
- **Cluster:** microk8s-cluster
|
||||||
|
- **API Server:** https://23.120.207.35:16443
|
||||||
|
- **Config:** ~/.kube/config
|
||||||
|
- **User:** admin
|
||||||
|
|
||||||
|
## Traefik (Reverse Proxy)
|
||||||
|
|
||||||
|
- **Config:** ~/traefik.yml
|
||||||
|
- **HTTP:** :80 (redirects to HTTPS)
|
||||||
|
- **HTTPS:** :443
|
||||||
|
- **Dashboard:** Enabled (insecure)
|
||||||
|
- **Let's Encrypt:** admin@fetcherpay.com
|
||||||
|
|
||||||
|
## Docker Containers (Running)
|
||||||
|
|
||||||
|
| Container | Image | Ports |
|
||||||
|
|-----------|-------|-------|
|
||||||
|
| mt5 | gmag11/metatrader5_vnc:1.1 | 3000, 8001, 3001 |
|
||||||
|
| temporal-ui | temporalio/ui:latest | 8233->8080 |
|
||||||
|
| temporal | temporalio/auto-setup:latest | 6933-6935, 6939, 7233-7235, 7239 |
|
||||||
|
| adminer | adminer:latest | 8080 |
|
||||||
|
| fetcherpay-api | node:18-alpine | - |
|
||||||
|
| grafana | grafana/grafana:latest | 3000 |
|
||||||
|
| prometheus | prom/prometheus:latest | 9090 |
|
||||||
|
| mysql | mysql:8.0 | 3306, 33060 |
|
||||||
|
|
||||||
|
## Gitea Runner
|
||||||
|
|
||||||
|
- **Path:** ~/gitea-runner/
|
||||||
|
- **Runner file:** .runner
|
||||||
|
- **Log:** runner.log
|
||||||
|
|
||||||
|
## Project Repositories
|
||||||
|
|
||||||
|
| Project | Path |
|
||||||
|
|---------|------|
|
||||||
|
| MQL Trading Bots | ~/mql-trading-bots/ |
|
||||||
|
| MT5 Docker | ~/mt5-docker/ |
|
||||||
|
| MT4 Docker | ~/mt4-docker/ |
|
||||||
|
| Fetcherpay Docs | ~/fetcherpay-docs/ |
|
||||||
|
| Fetcherpay K8s | ~/fetcherpay-k8s/ |
|
||||||
|
| Fetcherpay Marketing | ~/fetcherpay-marketing/ |
|
||||||
|
| Conversation History | ~/conversation-history/ |
|
||||||
|
|
||||||
|
## K8s Deployments (from fetcherpay-k8s/)
|
||||||
|
|
||||||
|
- fetcherpay-complete.yaml
|
||||||
|
- temporal-combined.yaml
|
||||||
|
- temporal-complete-stack.yaml
|
||||||
|
- temporal-ui-deployment.yaml
|
||||||
|
- poste-email.yaml
|
||||||
|
|
||||||
|
## SSH Access
|
||||||
|
|
||||||
|
- Current SSH connection: 192.168.1.65 (pts/4)
|
||||||
|
- Local users: garfield (seat0, :0, pts/4)
|
||||||
70
README.md
Normal file → Executable file
70
README.md
Normal file → Executable file
@@ -6,31 +6,54 @@ This repository stores session notes and project context for AI-assisted develop
|
|||||||
|
|
||||||
| Date | Project | Summary | File |
|
| Date | Project | Summary | File |
|
||||||
|------|---------|---------|------|
|
|------|---------|---------|------|
|
||||||
| 2026-03-21 | MQL Trading Bots | Verified 19% profit, fixed bugs, migrated to Gitea | [2026-03-21-mql-trading-bots.md](2026-03-21-mql-trading-bots.md) |
|
| 2026-03-30 | Weekend Gap & Short Signals | Fixed weekend protection, short signal detection | [2026-03-30-weekend-gap-short-signal-fix.md](2026-03-30-weekend-gap-short-signal-fix.md) |
|
||||||
|
| 2026-03-29 | Settings Library | Created 24 .set files, critical bug fixes | [SESSION_SAVE_2026-03-29.md](SESSION_SAVE_2026-03-29.md) |
|
||||||
|
| 2026-03-21 | Initial Verification | Verified 19% profit, Gitea migration | [2026-03-21-mql-trading-bots.md](2026-03-21-mql-trading-bots.md) |
|
||||||
|
|
||||||
## How to Use This Repository
|
## How to Use This Repository
|
||||||
|
|
||||||
|
### For AI Agents:
|
||||||
|
1. Read `AGENTS.md` first - contains technical context
|
||||||
|
2. Check `conversation-history/` for session notes
|
||||||
|
3. Read latest README for current status
|
||||||
|
|
||||||
### For Returning Users:
|
### For Returning Users:
|
||||||
1. Read the latest session file for your project
|
1. Read the latest session file for your project
|
||||||
2. Share the file content with AI at start of new session
|
2. Share the file content with AI at start of new session
|
||||||
3. AI will have full context of previous work
|
3. AI will have full context of previous work
|
||||||
|
|
||||||
### For New Projects:
|
---
|
||||||
1. Create new session file: `YYYY-MM-DD-project-name.md`
|
|
||||||
2. Document what was built, configured, and decided
|
|
||||||
3. Include file locations, settings, and performance data
|
|
||||||
4. Commit and push to preserve context
|
|
||||||
|
|
||||||
## Project Index
|
## Project Index
|
||||||
|
|
||||||
### Active Projects
|
### Active EAs
|
||||||
- **mql-trading-bots** - MetaTrader EA development (profitable!)
|
|
||||||
- Repository: http://10.152.183.192:3000/garfield/mql-trading-bots
|
|
||||||
- Status: Active, ~19% return achieved
|
|
||||||
- Last Session: 2026-03-21
|
|
||||||
|
|
||||||
### Future Projects
|
| EA | Version | Status | Purpose |
|
||||||
(Add new projects here as they're started)
|
|----|---------|--------|---------|
|
||||||
|
| MultiSignal_Confluence_EA.mq5 | v1.14 | ✅ Active | Pivot+Candle+Harmonic confluence |
|
||||||
|
| OrdersEA_Smart_Grid.mq5 | v3.1 | ✅ Active | Grid trading around pivots |
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
|
||||||
|
| Account | Period | Return | Win Rate |
|
||||||
|
|---------|--------|--------|----------|
|
||||||
|
| 104125640 | March 2026 | ~15-19% | 46-87% |
|
||||||
|
| 103477358 | February 2026 | ~4% | - |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Critical Fixes (Chronological)
|
||||||
|
|
||||||
|
| Date | Version | Fix |
|
||||||
|
|------|---------|-----|
|
||||||
|
| 2026-03-21 | v1.11 | Stop loss cross-symbol contamination |
|
||||||
|
| 2026-03-21 | v1.12 | Volatility/ADX filters |
|
||||||
|
| 2026-03-29 | v1.13 | Daily drawdown protection |
|
||||||
|
| 2026-03-29 | v3.0 | Grid daily forced closure bug |
|
||||||
|
| 2026-03-30 | v1.14 | Short signal detection |
|
||||||
|
| 2026-03-30 | v3.1 | Weekend gap protection |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Template for New Sessions
|
## Template for New Sessions
|
||||||
|
|
||||||
@@ -39,7 +62,7 @@ This repository stores session notes and project context for AI-assisted develop
|
|||||||
|
|
||||||
## Participants
|
## Participants
|
||||||
- User: [Name]
|
- User: [Name]
|
||||||
- AI: Kimi Code CLI
|
- AI: [AI Assistant]
|
||||||
|
|
||||||
## Session Overview
|
## Session Overview
|
||||||
Brief summary of what was done.
|
Brief summary of what was done.
|
||||||
@@ -60,16 +83,29 @@ Files modified, settings, configurations.
|
|||||||
What needs to be done next.
|
What needs to be done next.
|
||||||
|
|
||||||
## Session Status: [IN PROGRESS / COMPLETE]
|
## Session Status: [IN PROGRESS / COMPLETE]
|
||||||
|
```
|
||||||
|
|
||||||
## 📊 Trading Performance Reports
|
---
|
||||||
|
|
||||||
|
## Trading Performance Reports
|
||||||
|
|
||||||
| Report | Date | Account | Return | File |
|
| Report | Date | Account | Return | File |
|
||||||
|--------|------|---------|--------|------|
|
|--------|------|---------|--------|------|
|
||||||
| Account 104125640 Analysis | 2026-03-21 | 104125640 | 6.9% | [2026-03-21-mql-trading-report-analysis.md](2026-03-21-mql-trading-report-analysis.md) |
|
| March Analysis | 2026-03-21 | 104125640 | 6.9% | [2026-03-21-mql-trading-report-analysis.md](2026-03-21-mql-trading-report-analysis.md) |
|
||||||
|
|
||||||
### Quick Stats
|
### Quick Stats
|
||||||
- **Best Win Rate**: 86.67% (13/15 trades)
|
- **Best Win Rate**: 86.67% (13/15 trades)
|
||||||
- **Profit Factor**: 2.52
|
- **Profit Factor**: 2.52
|
||||||
- **Current Balance**: $106,935.12 (from $100k start)
|
- **Current Balance**: ~$115,000 (from $100k start)
|
||||||
- **Strategy**: MultiSignal Confluence EA on USDJPY H1
|
- **Strategy**: MultiSignal Confluence EA on USDJPY H1
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Gitea Repository
|
||||||
|
|
||||||
|
- **URL:** https://git.fetcherpay.com/garfield/mql-trading-bots
|
||||||
|
- **Last Push:** 2026-03-30
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Last Updated: 2026-03-30*
|
||||||
|
|||||||
0
REPOSITORIES.md
Normal file → Executable file
0
REPOSITORIES.md
Normal file → Executable file
0
SESSION_SAVE_2026-03-22.md
Normal file → Executable file
0
SESSION_SAVE_2026-03-22.md
Normal file → Executable file
0
TEMPLATE.md
Normal file → Executable file
0
TEMPLATE.md
Normal file → Executable file
Reference in New Issue
Block a user