MT4 Telegram Trade Notifier (Bot API) — Trade Alerts - MetaTrader 4 Expert

Overview
TelegramTradeNotify is a lightweight MT4 utility EA that uses the Telegram Bot API (sendMessage) to send trade notifications to Telegram.
Send alerts when trades are opened or closed (order based detection in MT4)
Optional filter: Buy/Sell only
UTF-8 URL encoding (Vietnamese and emoji supported)
Optionally disable web page preview
Simple input: bot token, chat ID, timeout, prefix
How it works (MT4)
MT4 does not offer "trading" events like MT5. The EA monitors the total number of trading orders () and order history total () by scanning on a regular basis.
The EA sends a Telegram message when a new order appears (open a position) or a new record is added to the history (close a position).
Create a Telegram bot and get the bot token.
Get your target chat ID (user/group) or use @channelusername.
In MetaTrader 4: Tools → Options → Expert Advisor
Enable "Allow WebRequests for listed URLs" and add: https://api.telegram.org
Attach the EA to any chart and set:
Precautions/Troubleshooting
If the WebRequest fails, check your network/firewall/DNS and make sure the URL is allowed in the MT4 options.
Some networks/VPS may block Telegram; switching networks or using a relay server may help.
This EA is just a notification utility. It does not open or manage transactions.
InpBotToken: Telegram Bot Token
InpChatId: Chat ID or @channelusername
InpSendTestOnInit: Send test message when EA starts
InpNotifyBuySellOnly: Notify buy/sell orders only
InpTimeoutMs: Web request timeout
InpMsgPrefix: message prefix
Attachment download
📎TelegramTradeNotify.mq4 (20.87 KB)
Source: MQL5 #68617
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •