Telegram 4 MQL - A .NET library for exchanging messages between Metatrader and Telegram

 

Description:

Telegram 4 MQL was made to make the life of an automtic trader a bit more convenient or better to say it was made to spare nerves. Suitable questions while operating an autotrading systems are:

  • Was the order correctly executed?
  • Did an situation change an unusual way so that I need to interfere remotely?
  • ...

Then you may think about an solution that depends on high available services that you can easily base on and stay tuned to your automatic trading bots. That is where Telegram 4 MQL comes into the game.

Sample Screenshot:

Here is a screenshot that shows a sample workflow:

  • You have an active EA running that observerves some market data and sends a notification if a specific value was exceeded
  • As a reaction you want to place an order.
  • You get a confirmation that the order was successfully placed.

sample_screenshot

Sample Implementation:

The following code snippet shows how easy it is to use this library:

//+------------------------------------------------------------------+
//| Import block for the Telegram 4 MQL functions                                    |
//+------------------------------------------------------------------+
#import "Telegram4Mql.dll"
   string TelegramSendTextAsync(string apiKey,string chatId,string chatText);
   string TelegramSendText(string apiKey,string chatId,string chatText);
   string TelegramSendScreenAsync(string apiKey,string chatId,string caption="");
   string TelegramSendScreen(string apiKey,string chatId,string caption="");
   string TelegramGetUpdates(string apiKey,string validUsers,bool confirmUpdates);
#import

// ...

//+------------------------------------------------------------------+
//| Here is a code block with sample calls.                          |
//| For the complete documentation please visit                      |
//| http://telegram4mql.steven-england.info/doc                      |
//+------------------------------------------------------------------+

void testTelegram4Mql()
  {
   string apiKey="112141336:xxxxxxxxxxxxxxxxxxxx"; // Your API key
   string chatId="14xxxxxx"; // Chat ID or username

   /* The following functions will print '0' if everything goes just fine. */
   Print(TelegramSendText(apiKey,chatId,"test"));
   Print(TelegramSendTextAsync(apiKey,chatId,"test async"));
   Print(TelegramSendScreen(apiKey,chatId,"test photo"));
   Print(TelegramSendScreenAsync(apiKey,chatId,"test async photo"));

   /* 
    The following function will print '0' if everything goes just fine
    followed by the amount of updates received in total
    and the commands from authorized users.
    */
   Print(TelegramGetUpdates(apiKey,chatId,true));
  }
//+------------------------------------------------------------------+

Further Information:

Because documentation affort may increase over time the documentation is considered to be placed outside of this website. You can find

  • Downloads
  • Examples
  • Issue information
  • ...

under

http://telegram4mql.steven-england.info/


Related Work:

Another very good work, implemeted in native MQL in contrast to this work, can be found here: https://www.mql5.com/en/articles/2355 - How to create Telegram Bots in MQL5. Have a look at it also, because this solution meets other requirements than Telegram 4 MQL.

 

I made a code that use Telegram4Mql.dll

This code work well.

But today i received this Error and my EA stop send messages !!!!

Error is : Object reference not set to an instance of an object.


Please let me know more why this error occurred.

 
Someone got the code working successfully?
 
can Some one please make a youtube video of how to do this
 

who know what happened to the site?


and what this is this problem?



2019.05.12 17:40:17.865 2019.01.02 22:00:00  ABCDDDDD_____AAAAAA     EURUSD,H1: Telegram#2 CND Send Photo $$ = 90002|The operation timed out and was cancelled.|System.Threading.Tasks.TaskCanceledException: A task was canceled.

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)

   at kkt;1P:?\&\*J%pTfrNb\\Q{/Zn#.EOL'T2}`CDxa!)J

 
stev_io:

Description:

Telegram 4 MQL was made to make the life of an automtic trader a bit more convenient or better to say it was made to spare nerves. Suitable questions while operating an autotrading systems are:

  • Was the order correctly executed?
  • Did an situation change an unusual way so that I need to interfere remotely?
  • ...

Then you may think about an solution that depends on high available services that you can easily base on and stay tuned to your automatic trading bots. That is where Telegram 4 MQL comes into the game.

Sample Screenshot:

Here is a screenshot that shows a sample workflow:

  • You have an active EA running that observerves some market data and sends a notification if a specific value was exceeded
  • As a reaction you want to place an order.
  • You get a confirmation that the order was successfully placed.


Sample Implementation:

The following code snippet shows how easy it is to use this library:

Further Information:

Because documentation affort may increase over time the documentation is considered to be placed outside of this website. You can find

  • Downloads
  • Examples
  • Issue information
  • ...

under

http://telegram4mql.steven-england.info/


Related Work:

Another very good work, implemeted in native MQL in contrast to this work, can be found here: https://www.mql5.com/en/articles/2355 - How to create Telegram Bots in MQL5. Have a look at it also, because this solution meets other requirements than Telegram 4 MQL.

void testTelegram4Mql()
  {
   string apiKey="112141336:xxxxxxxxxxxxxxxxxxxx"; // Your API key
   string chatId="14xxxxxx"; // Chat ID or username <<<< This is charging the ID for Mql or Telegram, please instructions ......????????
 

FiboMasterTrade:

 string chatId="14xxxxxx"; // Chat ID or username <<<< This is charging the ID for Mql or Telegram, please instructions ......????????

Thats the chat_id from the telegram user you are communicating with.

So not MQL5 account.

 
Does anyone have this library as it seems the site is down and I can't find it anywhere , I tried to google it but found nothing
 
Does anyone have a copy of the library?
 

Here it is https://www.mql5.com/en/articles/download/2355/telegram.zip 

This is the native MQL one from the article mentioned above.

 
Kareem Abdelhakim:
Does anyone have this library as it seems the site is down and I can't find it anywhere , I tried to google it but found nothing

The site is online again. But I made a successor library that is available here: https://mmm.steven-england.info If you have any further questions let me know.

MMM | MMM Home
  • mmm.steven-england.info
great to see you here. Hopefully you entered this website because you are a MetaTrader user in general, ideally a MetaTrader user that does automatic trading or wants to share trading signals with other users and in the best case you're looking for a possibility to establish a communication channel between MetaTrader and a messenger. Does this...