Notify to Telegram MT5
- Utilitários
- Nguyen An Nguyen
- Versão: 1.0
As this is a free version, some features may not be fully developed yet. I ask for your kind understanding and hope you’ll share your feedback with me directly instead of leaving a negative review. I’m committed to improving and truly grateful to have you as a user.
A MetaTrader 5 Expert Advisor (EA) that forwards your trading activity to Telegram (open / close / modify / partial close / pending activate). It also includes optional chart screenshots and daily/weekly history reports.
1. Preparation
Create a Telegram bot:
-
Open @BotFather on Telegram → send /newbot → follow the prompts and save your Bot Token.
-
Get your Chat ID:
-
For personal chats: message @userinfobot .
-
For channels/groups: add your bot as an admin, then copy the ID (channel IDs usually start with -100 ).
-
Allow WebRequest in MT5:
-
Go to Tools → Options → Expert Advisors → check "Allow WebRequest for listed URL" → add https://api.telegram.org .
Enable AutoTrading: - Make sure the "Algo Trading" (or AutoTrading) button on the MT5 top toolbar is turned on (green).
2. Installation
-
Download/buy the EA from the MQL5 Market and install it.
-
Drag and drop the EA onto any single chart.
-
Enter your InpBotToken and InpChatId in the inputs, then click OK.
-
Check the top-left corner of the chart. If it says TTN v1.0.0 | OK | … , you are all set!
Tip: Open a demo trade to test the connection. You should receive a Telegram alert within 1–2 seconds.
3. Inputs & Settings
| Input Parameter | Default | Description |
|---|---|---|
| InpBotToken | (empty) | Your Bot Token from BotFather. (Required) |
| InpChatId | (empty) | Your target Chat, Channel, or Group ID. (Required) |
| InpLogLevel | LOG_INFO | Controls log detail level ( ERROR / WARNING / INFO / DEBUG ). |
| InpEnableDaily | false | Sends a daily report at InpReportHour:Minute (covers the last 24h). |
| InpEnableWeekly | false | Sends a weekly report on Sundays (covers the last 7 days). |
| InpReportHour | 23 | Hour to send reports (0–23, based on broker server time). |
| InpReportMinute | 0 | Minute to send reports (0–59). |
| InpSendEmptyReports | false | Sends a report even if 0 trades were closed. |
| InpEnableScreenshot | false | Attaches a chart screenshot to NEW and CLOSE order alerts. |
Note: To change your settings later, simply remove the EA from the chart and re-attach it with your new inputs.
4. On-Chart Status
The EA displays a status line in the top-left corner of your chart:
TTN v1.0.0 | <state> | Last: HH:MM:SS | Errors: N
| State | Meaning |
|---|---|
| OK | Ready and working properly. |
| OBSERVER | Another EA instance is already using this bot/chat. This EA stays silent to prevent duplicate alerts. |
| ERROR | Incorrect token/chat ID, or a Telegram connection error. |
5. Troubleshooting
"ERROR" Status:
-
You likely entered the wrong Bot Token or Chat ID. Re-attach the EA with the correct values.
-
You forgot to add https://api.telegram.org to the WebRequest allowlist in MT5 Options.
No messages received:
-
Is the on-chart status showing "OK"?
-
Is AutoTrading enabled?
-
Check the Experts tab at the bottom of the MT5 terminal for specific [ERROR] messages.
Error 429 (Rate Limit): - Telegram restricts bots to roughly 30 messages per second. If you get this error, disable screenshots or reduce your trading frequency.
