Discussion of article "How to create bots for Telegram in MQL5" - page 8

 
HoangMinh891


If it is possible to increase the size, you can do it in this line of code:

 if(ChartScreenShot(chart_id,filename,1024,768,ALIGN_RIGHT))
 
satrifx7 :


Well, upload the code to see it. Both mql4 and mql5.


Thank you

 

When I use Telegram_Search_EA on MT5 I have unknown error 1001 or 1003.

On MT4 it works properly.

 
Nicholas Martins:

Thanks for sharing this code!

I just have a small issue, one of my brokers has lowercase letter on some symbols like EURUSDm, GBPUSDm, XAUUSDm...s 

Did you try Just sending without the m

or better yet this 

#include <Telegram.mqh>
input sring InpChannel;
input string InpToken;
void OnStart()
    {
        bot.Token(InpToken);
        string msg = "This currency pair/symbol is called: "+Symbol();
        bot.sendmessage(InpChannel, msg);
    }
 
Andrey Voytenko:

Thanks for your positive feedback. But WebRequest() function cannot be executed in the Strategy Tester.


Dear Andrey,

thank you for your wonderful article!

Since WebRequest() function doesn't work with strategy tester, is there a way to receive notifications with bots while executing the Strategy Tester?

Thank you

 
Jefferson Metha:

Did you try Just sending without the m

or better yet this 

//+------------------------------------------------------------------+
string CTelebot::TradeSymbol(string txt)
  {
   string symbol;
   if(SymbolFind(txt))
     {
      symbol = txt;
      return symbol;
     }
   if(SymbolFind(txt + suffix))
     {
      symbol = txt + suffix;
      return symbol;
     }
   if(SymbolFind(GetSymbolDescription(txt)))
      return GetSymbolDescription(txt);
   else
      // symbol = SymbolGet(txt);
      symbol = "EMPTY";
   return symbol;
  }
//--------------------------------------------------+



I have a small problem guys How do I get channel / group name using chat.m_id

 
Andrey Voytenko:

Please fix the line 117:

Dear Andrey,

Your work is impressive! And the jobs performed as well


I have 1 issue and 1 question for the Telegram_Bot_EA

1. I get this message on the mt4. What could be the reason for it? Can you help with a solution?

   0    08:25:24.546    Telegram_Bot_EA mt4 GBPUSD,H1: Screenshot file 'NZDUSD60.gif' not created.

2. Where I have to change the size of the font of the Telegram buttons? - I would like to make the text a bit smaller


Thanks in advance for your help!

 

@Deyan Ivanov

I have this problems too, this is my code fixed for MT4. Edit file "Telegram_Bot_EA.mq4" replace method "int SendScreenShot(...)"

//+------------------------------------------------------------------+
   int               SendScreenShot(const long _chat_id,
                                    const string _symbol,
                                    const ENUM_TIMEFRAMES _period,
                                    const string _template=NULL)
     {

	......................

      Sleep(50);

      bool resultShot = ChartScreenShot(chart_id,filename,2560,1200,ALIGN_RIGHT);
      ChartClose(chart_id);
      if(resultShot)
        {
         Sleep(500);

         bot.SendChatAction(_chat_id,ACTION_UPLOAD_PHOTO);

         //---
         if(FileIsExist(filename))
           {
            string screen_id;
            result=bot.SendPhoto(photo_id,_chat_id,filename,_symbol+"_"+StringSubstr(EnumToString(_period),7));
           }
         else
           {
            string mask=m_lang==LANGUAGE_EN?"Screenshot file '%s' not created.":"Файл скриншота '%s' не создан.";
            PrintFormat(mask,filename);
           }

        }


      
....................
     }
 
Hello, Andrey. Could you help me please - is there a way to send a message about closing a deal with/without takeprofit?
 
volohovnp:
Hello, Andrey. Could you help me please - is there a way to send a message about closing a deal with/without takeprofit?
I send a comment with each trade, then I send message stating Symbol, OrderType and the Comment, and the Action I want done 

Message e.g
Close 
EurUSD Buy 
Trade #23 

Or 

Close by 0.21 lots    or Close by 50% 
<Other parameters I will change based on Order>
Reason: