Write, debug, and tune Playwright specs with locator strategy, trace diagnosis, and CI-aware timeouts.
Coding
MT5 Headless Automation
Try itRun MetaTrader 5 (MT5) fully headless on Linux/VPS: Wine + Xvfb + xdotool + OCR. Install, log in, attach EAs, deploy experts, monitor heartbeat and auto-restart. Built from real production experience (Vantage, 17 symbols, DRT-Axe EA). Perfect for traders who want to run EAs 24/7 without a screen. ⚠️ WARNING: runs system-level commands (wine, Xvfb, sudo apt), can restart MT5/terminate processes, and handles broker login credentials.
What it does
Run MetaTrader 5 on a server WITHOUT a screen — full EA automation 24/7.
The skill document
MT5 Headless Automation 🖥️🤖
Run MetaTrader 5 on a server WITHOUT a screen — full EA automation 24/7.
⚠️ Important (read first)
- System-level actions: this skill installs packages (sudo apt), starts Xvfb/Wine, and runs shell scripts. Review before running on production.
- Restarts can interrupt trading: the watchdog auto-restarts MT5 and may terminate EA processes during active sessions — this can detach strategies or affect open positions.
- Credentials: broker login (terminal64.exe via Wine) uses your MT5 account/password. They are entered into the terminal and may appear in process arguments or logs — store them in env vars or a protected file, never in scripts committed to git. Use a read-only/demo account for testing.
- Built from production experience — but backtest/production results are historical and not guaranteed.
What this skill does
- Install MT5 + Wine + Xvfb (headless display)
- Log in to broker account (terminal64.exe via Wine)
- Attach EAs via Navigator (Ctrl+N → OCR → double-click → Enter)
- Deploy EA changes with 1 command (copy → compile → restart → verify)
- Monitor heartbeat — auto-restart if the EA hangs
- Avoid the 5 classic pitfalls (documented below)
Quick start
# 1) Environment
sudo apt install wine xvfb xdotool tesseract-ocr scrot
Xvfb :99 -screen 0 1280x720x24 &
export DISPLAY=:99
# 2) Install MT5 (Windows installer via Wine)
wine "mt5setup.exe" /auto
# 3) Attach EA (scripts/attach_ea.sh)
bash scripts/attach_ea.sh "DRT-Axe"
# 4) Deploy new EA version (scripts/deploy_ea.sh)
bash scripts/deploy_ea.sh
The 5 classic pitfalls (we have hit them ALL)
| # | Pitfall | Symptom | Fix |
|---|---|---|---|
| 1 | ArraySetAsSeries missing | EA reads history backwards → 0 trades | ArraySetAsSeries(rates, true) after every CopyRates |
| 2 | EA unloads on MT5 restart | "EA running" but HB file frozen | Attach MANUALLY after each restart (auto-attach unreliable) |
| 3 | Log freshness ≠ EA running | False positive in monitor | Check HB file mtime, not log lines |
| 4 | pkill -f kills itself | Script dies suddenly | pkill -f "pa[t]tern" or kill $(lsof -ti:PORT) |
| 5 | xdotool coordinates change | Click on wrong place | OCR-find the element each time (tesseract + tsv) |
Files
mt5-headless-automation/
├── SKILL.md
└── scripts/
├── attach_ea.sh # OCR-guided EA attach via Navigator
├── deploy_ea.sh # 1-command: copy → compile → restart → verify
├── watchdog.sh # Heartbeat check + auto-restart
└── ea_fix.py # Diagnose why the EA is not trading
Verification (always!)
- EA log:
MQL5/Files/_Log.txt(server time GMT+3) - Heartbeat:
_HB.txt— mtime must be < 60 sec old - Data:
_Data.json(real-time klines every 60s) - ex5 MD5 must match workspace copy after deploy
Related skills
Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.
Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.
Save, search, and manage personal notes and knowledge bases in Get笔记 on explicit request.
Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.
Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.
More from northcap-group
Browse all skillsDealing Range Theory (DRT) — complete ICT structure: Type 1 (continuation), Type 2 (reversal), Type 3 (consolidation), quadrant levels (25/50/75), entry models, SMT confirmation and news filter. For market analysis and trade setups.
Crypto DRT scalping strategy + backtest reference on 12 crypto pairs (TRX, BNB, BTC, LINK, AVAX, DOGE, SOL, NEAR, XRP, LDO, ADA, ETH), all 7 days. Backtested 2 years (~400+ trades). 100% lokal backtest-reference — ingen netværkskald, ingen API-nøgle. Backtest results are historical and not a guarantee of future performance.
Provides pay-per-call crypto trading signals with entry, stop-loss and take-profit via the x402 standard (USDC on Ethereum). Live DRT/ICT signals for agents and traders.
How the world's best entrepreneurs network, negotiate, and create partnerships. Relationships that build millions.
Crypto DRT scalping — Dealing Range Theory on 12 crypto pairs (TRX, BNB, BTC, LINK, AVAX, DOGE, SOL, NEAR, XRP, LDO, ADA, ETH), all 7 days. Backtested 2 years (~400+ trades). Backtest results are historical and not a guarantee of future performance. Separate play-money account rules.
How to build wealth from zero — bootstrapping, scaling strategies, resource allocation, and wealth mindset. Strategic advisory for Mohamed.