Discussing the article: "Creating an MQL5-Telegram Integrated Expert Advisor (Part 2): Sending Signals from MQL5 to Telegram"

 

Check out the new article: Creating an MQL5-Telegram Integrated Expert Advisor (Part 2): Sending Signals from MQL5 to Telegram.

In this article, we create an MQL5-Telegram integrated Expert Advisor that sends moving average crossover signals to Telegram. We detail the process of generating trading signals from moving average crossovers, implementing the necessary code in MQL5, and ensuring the integration works seamlessly. The result is a system that provides real-time trading alerts directly to your Telegram group chat.

In the first part of our series on developing a Telegram-integrated Expert Advisor for MQL5, we covered the essential steps needed to link MQL5 and Telegram. Setting up the actual application was the first step. After that, we moved on to the coding part. The reason for this particular order of events will hopefully become clearer in the next paragraphs. The upshot is that we now have a bot that can receive messages, as well as a program that can send them. We have also written a simple MQL5 program demonstrating how to send a message via the bot to the application.

Having set the foundation in Part 1, we can now proceed to the next step: transmitting trading signals to Telegram using MQL5. Our newly enhanced Expert Advisor does something quite remarkable: It not only opens and closes trades based on preset conditions but also performs the equally impressive feat of transmitting a signal to a Telegram group chat to let us know a trade was executed. The trading signals themselves have gone through a bit of a makeover, ensuring that the information we send to Telegram is as clear and concise as possible. Our "Chatty Trader" does a better job of talking to the group in Telegram than our previous version, and it does so at the same or faster pace than our old "Chatty Trader" had, which means we can expect to receive signals nearly in real-time as trades are taken or closed.



We will generate signals based on the famous moving average crossover system and relay the generated signals. In addition, if you recall, in part 1 of the series, we had just a single message that could be pretty long, and if someone wanted to add segments to the message, it would result in an error. Thus, only a single message could be sent at a time, and if there were extra segments, they would have to be relayed in different individual messages. For example, sending “A buy signal has been generated.” and “Open a buy order.”, would be either a single long message or two short messages. In this part, we will concatenate them and modify the message so that a single message can contain several text segments and characters.

Author: Allan Munene Mutiiria