0894d18db4
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
3.0 KiB
Executable File
3.0 KiB
Executable File
N8N SSH Setup - Run validate-settings.sh
Overview
Use n8n's SSH node to run the validation script on localhost.
Prerequisites
✅ SSH is running on localhost (confirmed)
✅ User garfield exists
Setup Steps
1. Create SSH Key for n8n (Recommended)
# Generate SSH key (no passphrase for automation)
ssh-keygen -t ed25519 -f ~/.ssh/n8n_key -N ""
# Copy public key to authorized_keys
cat ~/.ssh/n8n_key.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
# Test connection
ssh -i ~/.ssh/n8n_key garfield@localhost "echo 'SSH works!'"
2. Import Workflow
- Open n8n: http://localhost:5678
- Click "Add Workflow"
- Click "Import from File"
- Select:
n8n-workflow-ssh-local.json
3. Configure SSH Credentials
In n8n:
- Click the "SSH - Run Validation" node
- Click "Create New Credential"
- Choose "SSH Password" (or SSH Private Key if you created one)
- Enter:
- Host:
localhost - Port:
22 - User:
garfield - Password: Your user password (or path to private key)
- Host:
4. Configure Telegram (Optional)
- Get bot token from @BotFather
- Get chat ID from @userinfobot
- Add Telegram credentials in n8n
5. Activate
- Toggle "Active" in top-right
- Click "Save"
Testing
Manual Trigger
Click "Execute Workflow" to test immediately.
Check Output
The SSH node will return:
stdout: Script outputcode: Exit code (0 = success, >0 = issues found)
Alternative: Simple HTTP Endpoint
If SSH doesn't work, create a simple HTTP endpoint:
1. Create API Script
sudo tee /usr/local/bin/mql-validate-api.sh << 'EOF'
#!/bin/bash
echo "Content-Type: application/json"
echo ""
cd /home/garfield/mql-trading-bots
OUTPUT=$(./scripts/validate-settings.sh 2>&1)
CODE=$?
if [ $CODE -eq 0 ]; then
echo '{"status":"ok","message":"All checks passed"}'
else
echo "{\"status\":\"error\",\"code\":$CODE,\"message\":\"Issues found\",\"stdout\":\"$OUTPUT\"}"
fi
EOF
sudo chmod +x /usr/local/bin/mql-validate-api.sh
2. Setup Python HTTP Server
cd /home/garfield/mql-trading-bots
python3 -m http.server 8080 &
3. Use HTTP Request Node
Import: n8n-workflow-http.json
Troubleshooting
"Connection refused" error
# Check SSH is listening
sudo systemctl status sshd
# Check port
netstat -tlnp | grep 22
"Permission denied" error
# Check file permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Script not found
# Verify path
ls -la /home/garfield/mql-trading-bots/scripts/validate-settings.sh
Security Notes
- Use SSH keys instead of passwords when possible
- Restrict n8n key to only run validation script in
~/.ssh/authorized_keys:command="/home/garfield/mql-trading-bots/scripts/validate-settings.sh",no-pty,no-port-forwarding ssh-ed25519 AAAAC3... n8n@local - Keep n8n behind firewall/VPN
Manual Test
Test the script manually:
/home/garfield/mql-trading-bots/scripts/validate-settings.sh
echo "Exit code: $?"