MT5 Expert Advisor + Discord bot for automated Forex trading signals with Gold VIP channel
MonsterFX Reliable Trader v5.0
A complete automated trading system that connects MetaTrader 5 to a Discord community server via a Python webhook bot.
How It Works
MT5 (EA running on chart)
โ
โ HTTP POST (JSON)
โผ
Python Bot (Flask webhook server)
โ
โ Discord API
โผ
Discord Server (channels: open trades, closed trades, gold signals, daily report)
- The MT5 Expert Advisor detects trade signals, opens/closes positions, and sends updates to the Python bot over HTTP.
- The Python bot receives those updates and posts them as rich embeds to the correct Discord channels.
- Gold (XAUUSD) signals are sent to a VIP-only channel for manual execution โ Gold is never auto-traded.
- A daily report is posted at 21:00 UTC summarising all Gold signal performance.
Strategy
- Pairs: EURUSD, USDCAD, EURGBP (auto-traded) + XAUUSD (signals only)
- Timeframes: M15 trend filter + M5 entry
- Indicators: EMA 21/50 crossover, EMA 200 trend filter, RSI 14, VWAP, ATR-based SL/TP
- Session filter: London (08:00โ16:00 GMT) + New York (13:00โ21:00 GMT)
- Risk limits: Max 2 concurrent trades, max 7 trades/day, 20% max drawdown, 10% max daily loss
Setup
1. Python Bot
Install dependencies:
pip install -r requirements.txt
Configure environment:
cp env.example env
Edit _env and fill in:
| Variable | Description | |---|---| | DISCORDBOTTOKEN | Your bot token from Discord Developer Portal | | WEBHOOK_SECRET | Must match SecretKey in the MT5 EA settings | | WEBHOOK_PORT | Port the Flask server listens on (default: 5000) | | TRADEALERTSCHANNEL | Channel ID for closed trade alerts | | GOLDSIGNALSCHANNEL | Channel ID for Gold VIP signals | | BOTLOGSCHANNEL | Channel ID for bot logs | | SUBSCRIBER_ROLE | Role ID for paid subscribers | | GOLDVIPROLE | Role ID for Gold VIP (server boosters) |
Run the bot:
python3 bot_production.py
2. MT5 Expert Advisor
- Copy
MonsterFX_AutoTrader.mq5into your MT5MQL5/Experts/folder. - Compile it in MetaEditor (F7).
- In MT5: Tools โ Options โ Expert Advisors
http://127.0.0.1:5000
- Attach the EA to a chart and set:
ServerURL = http://127.0.0.1:5000
- SecretKey = same value as WEBHOOKSECRET in your env file
Important: Start the Python bot before attaching the EA in MT5, so the webhook server is ready when the EA sends its first startup message.
Discord Commands
| Command | Permission | Description | |---|---|---| | /status | Everyone | Show live account balance, equity, drawdown | | /trades | Everyone | List all currently open positions | | /gold | Admin | Manually send a Gold signal to the VIP channel | | /goldtp | Admin | Manually record a Gold TP/SL result | | /goldreport | Admin | Send the Gold daily report immediately | | /addsub | Admin | Grant subscriber role to a user | | /removesub | Admin | Remove subscriber role from a user |
Channel Structure (Recommended)
Discord Server
โโโ #open-trades โ Live open positions (auto-updated, auto-deleted on close)
โโโ #trade-alerts โ Closed trades + system messages
โโโ #gold-signals โ Gold VIP signals (visible to Gold VIP role only)
โโโ #gold-report โ Daily Gold performance report
Security Notes
- Never commit your
_envfile โ it is listed in.gitignore. - If your Discord bot token is ever shared publicly, regenerate it immediately in the Discord Developer Portal.
- The
WEBHOOK_SECRET/SecretKeyprevents unauthorised requests to the Flask server.
Files
| File | Description | |---|---| | bot_production.py | Main Python bot (Discord + Flask webhook server) | | MonsterFX_AutoTrader.mq5 | MT5 Expert Advisor source code | | requirements.txt | Python dependencies | | _env.example | Environment variable template | | _env | Your local secrets โ do not commit |