Join our fan page
- Views:
- 256
- Rating:
- Published:
- 2025.03.02 04:26
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
This Telegram module enables communication with Telegram by sending messages via the Telegram Bot API.
The function SendMessageToTelegram takes:
- a message, a chat ID, and a bot token as parameters to construct a JSON payload,
- and sends it using an HTTP POST request to the Telegram API.
It uses the WebRequest function to make the request, with a timeout of 5000 milliseconds. If the request is successful (HTTP 200 response), it prints a confirmation message; otherwise, it prints an error message along with the response details.
Application Examples
- Sending Signal Alerts
- Other Communication Tasks
Below is an example demonstrating how to use the Telegram.mqh module in an Expert Advisor (EA). I have developed a simple testing EA that sends a greeting message to Telegram upon initialization.
When integrating Telegram messaging into an EA, three key steps are essential:
1. Include the Telegram Module
- #include <Telegram.mqh>: Imports the module that provides the SendMessageToTelegram function.
2. Declare Telegram Credentials
- botToken: Input parameter to store your Telegram bot token.
- chatId: Input parameter to store your Telegram chat ID.
3. Send a Telegram Message
- Define Message: Create a greeting message string.
- Function Call: Use SendMessageToTelegram(message, chatId, botToken) within the OnInit() function.
- Feedback Handling: Print messages indicating success or failure based on the HTTP response.
TelegramSendTesting
The results in the Experts log from the image above show an attempt to send a message to Telegram, which failed due to incorrect credentials.

Time to candle Close. Dynamic text colours. Optimised for back-testing.

Whether you’re running multiple trading robots simultaneously or just one sophisticated strategy, keeping track of each Expert Advisor’s performance can be surprisingly time-consuming. MetaTrader 5 (MT5) conveniently displays orders and positions in its “Toolbox,” but when numerous robots share the same account, it becomes harder to know which EA is generating your profits—or losses. A single account might have dozens or hundreds of trades, each opened by different EAs, making it difficult to separate the results of one robot from another.

A zigzag indicator that uses a single input to adjust the step size for detecting wave direction changes

Zig Zag indicator that relies only on a minimum % of retracement to each previous wave , and optionally , being bigger than a specific size measured in atr units.