OVERVIEW
Transform your MT5 trading account into an automated signal execution station! This Expert Advisor automatically receives and executes trading signals from Telegram channels in real-time, enabling seamless copy trading operations from master accounts.
SYSTEM NOTICE: This EA receives and executes trading signals FROM Telegram channels. To broadcast signals TO Telegram, you need the companion EA:
"Telegram Signal Broadcaster MT5" (sold separately).
KEY FEATURES:
- Automated signal reception from Telegram channels
- Supports all order types (market, pending, limit, stop)
- Advanced signal filtering and validation
- Symbol transformation and mapping capabilities
- Multiple lot size calculation methods
- Position and order modification tracking
- Comprehensive risk management controls
- Real-time signal processing and execution
INPUT PARAMETERS
TELEGRAM BOT CONFIGURATION
- BotToken: Your Telegram bot authentication token (from @BotFather)
- ChannelUsername: Source channel username (without @ symbol)
- ChannelChatId: Alternative channel identification (for private channels)
- ConnectionCheckInterval: Bot connection verification frequency (seconds)
- MessageCheckInterval: Signal checking frequency (milliseconds)
TRADING CONTROL
- AutoTrade: Enable/disable automatic trade execution
- MagicNumber: Magic number for trade identification
- ShowOutput: Display debug information and status updates
SIGNAL FILTERING
- CheckPriceDistance: Skip trades if current price too far from signal
- MaxPriceDistancePoints: Maximum allowed price distance in points
- CheckTimeDelay: Skip trades if signal is too old
- MaxTimeDelaySeconds: Maximum allowed time delay in seconds
SYMBOL MANAGEMENT
- SymbolMapping: Transform symbols (FROM:TO pairs, comma-separated)
- SymbolPrefix: Prefix to add to MT5 symbol names
- SymbolSuffix: Suffix to add to MT5 symbol names
- SymbolsToTrade: Allowed symbols filter (comma-separated, empty = all)
LOT SIZE CONTROL
- FixedLot: Fixed lot size (0 = use signal calculation)
- LotMultiplier: Multiply signal lot sizes by this factor
TIME MANAGEMENT
- EnableTimeFilter: Enable time-based trading restrictions
- StartTime: Trading start time (HH:MM format)
- EndTime: Trading end time (HH:MM format)
ADVANCED OPTIONS
- ClosePositionIfPendingConverted: Close position if pending order converted on delete signal
SETUP INSTRUCTIONS
STEP 1: CREATE SEPARATE TELEGRAM BOT FOR SLAVE
- Open Telegram and search for @BotFather
- Send /newbot command
- Follow instructions to name your bot (different from master bot)
- Copy the bot token (e.g., 987654321:XYZabcDEFghiJKLmnoPQRstu )
- IMPORTANT: Each slave EA MUST use a separate bot token
STEP 2: ADD SLAVE BOT TO SIGNAL CHANNEL
- Add your new slave bot to the signal channel as administrator
- Give bot "Read Messages" permission (not "Post Messages")
- Note the channel username or Chat ID
STEP 3: ENABLE WEBREQUEST IN MT5
- Open MT5 → Tools → Options → Expert Advisors
- Check "Allow WebRequest for listed URL:"
- Add: https://api.telegram.org
- Click OK and restart MT5
STEP 4: INSTALL THE EA
- Copy Telegram Signal Subscriber MT5.ex5 to MQL5/Experts/ folder
- Restart MT5 or press Ctrl+R to refresh
- EA should appear in Navigator → Expert Advisors
STEP 5: CONFIGURE THE EA
- Attach Telegram Signal Subscriber MT5 to any chart
- Enable "Allow live trading" in EA settings
- Enter your slave bot token and channel information
- Configure trading parameters and filters
- Set symbol mappings if needed (e.g., GOLD:XAUUSD)
- Click OK
STEP 6: VERIFY OPERATION
- Check MT5 Experts tab for connection messages
- Verify bot connects to Telegram successfully
- Monitor signal reception in chart comment
- Test with a signal from master EA
SAMPLE SIGNAL PROCESSING
Input JSON Signal:
{ "action": "open", "symbol": "EURUSD", "trade_type": "buy", "open_price": 1.0850, "stop_loss": 1.0800, "take_profit": 1.0900, "balance_per_lot": 10000, "trade_id": "TG_20241001_001", "time_gmt": "2024-10-01 10:30:45" }
EA Processing Result:
- ✅ Signal received and validated
- ✅ Symbol mapping applied (if configured)
- ✅ Lot size calculated based on balance
- ✅ Price distance validated
- ✅ Time delay checked
- ✅ Trade executed successfully
SYMBOL TRANSFORMATION
The EA applies symbol transformations in this order:
- Mapping: Transform symbol names (e.g., GOLD → XAUUSD)
- Prefix: Add broker prefix (e.g., → EURUSD becomes Prefix.EURUSD)
- Suffix: Add broker suffix (e.g., EURUSD → EURUSD.pro)
Example Configuration:
- SymbolMapping: "GOLD:XAUUSD,US30:US30Cash"
- SymbolPrefix: "FX."
- SymbolSuffix: ".raw"
Result: GOLD signal becomes FX.XAUUSD.raw in MT5
LOT SIZE CALCULATION
Priority Order:
- FixedLot: If > 0, uses this value (ignores all other calculations)
- Direct Lot: If signal contains lot_size and balance_per_lot = 0
- Dynamic Calculation: Current balance ÷ balance_per_lot from signal
- LotMultiplier: Applied to final calculated lot size
Example:
- Master balance: $50,000, lot size: 1.0
- balance_per_lot transmitted: 25,000
- Slave balance: $10,000
- Calculated lot: $10,000 ÷ 25,000 = 0.4 lots
- With LotMultiplier 0.5: Final lot = 0.4 × 0.5 = 0.2 lots
SIGNAL FILTERING
Price Distance Filter:
- Prevents execution if market price moved too far from signal price
- Useful for delayed signals or high-volatility periods
- Example: MaxPriceDistancePoints = 50 means skip if price moved >50 points
Time Delay Filter:
- Prevents execution of old signals
- Compares signal timestamp with current time
- Example: MaxTimeDelaySeconds = 300 means skip signals older than 5 minutes
Symbol Filter:
- Restricts trading to specific symbols only
- Leave empty to allow all symbols
- Example: SymbolsToTrade = "EURUSD,GBPUSD,USDJPY"
Time Filter:
- Restricts new trade opening to specific hours
- Does not affect closing or modifications
- Supports overnight periods (e.g., 22:00 to 06:00)
TROUBLESHOOTING
EA NOT CONNECTING TO TELEGRAM:
- Verify slave bot token is correct and different from master
- Check WebRequest URL is added: https://api.telegram.org
- Ensure internet connection is stable
- Try restarting MT5
NO SIGNALS RECEIVED:
- Verify slave bot is added to signal channel
- Check bot has "Read Messages" permission
- Confirm channel username/ID is correct
- Ensure master EA is broadcasting signals
TRADES NOT EXECUTING:
- Check AutoTrade parameter is enabled
- Verify algorithmic trading is enabled in MT5
- Check signal filtering parameters
- Review symbol mapping configuration
SYMBOL NOT FOUND ERRORS:
- Configure symbol mapping in SymbolMapping parameter
- Check SymbolPrefix and SymbolSuffix settings
- Verify symbol exists in your broker's symbol list
- Try symbol transformation test
LOT SIZE ERRORS:
- Check FixedLot setting if using fixed lots
- Verify LotMultiplier is appropriate for your account
- Ensure calculated lot size meets symbol requirements
- Check minimum and maximum lot limits
SIGNAL FILTERING ISSUES:
- Review MaxPriceDistancePoints setting
- Check MaxTimeDelaySeconds for time-sensitive signals
- Verify SymbolsToTrade filter configuration
- Check EnableTimeFilter and trading hours
Common Issues Solutions:
- Connection timeouts: Increase ConnectionCheckInterval to 60+ seconds
- Rate limiting: Increase MessageCheckInterval to 500+ milliseconds
- Missing signals: Check if master EA is broadcasting correctly
- Permission errors: Ensure slave bot has read access to signal channel
- Symbol errors: Configure proper symbol mapping for your broker
- Lot size issues: Use FixedLot for consistent position sizing
IMPORTANT NOTES
Bot Token Requirements:
- Each slave EA MUST use a separate, unique bot token
- Multiple slaves CANNOT share the same bot token
- Create separate bots via @BotFather for each slave EA
- This prevents message conflicts and ensures reliable operation
Channel Access:
- Slave bots need "Read Messages" permission (not "Post Messages")
- Master bot needs "Post Messages" permission
- Private channels require Chat ID instead of username
Trading Permissions:
- Enable "Allow live trading" in EA settings
- Ensure algorithmic trading is enabled in MT5 Tools → Options
- Check that your broker allows automated trading
Remember: This Telegram Signal Subscriber MT5 receives signals FROM Telegram channels. To broadcast signals TO Telegram channels, you need:
Telegram Signal Broadcaster MT5: https://www.mql5.com/en/market/product/151449
Complete automated copy trading requires BOTH EAs:
- Telegram Signal Broadcaster MT5 (separate purchase) - Sends signals
- Telegram Signal Subscriber MT5 (this product) - Receives and executes signals