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

To add comments, please log in or register
Junior
7
Junior  

Thanks a lot Nguyen Van Tuan,
Now, it works with private channels. Before, my bot was working only in public channels.

Best Regards,
Junior


Nguyen Van Tuan:

Hi,

When i have tested with this Library of  Andrey Voytenkoon MT5, It not work well so i have some more simple step. Any people hit same error can try to change like me:

1. Confirm add https://api.telegram.org to Allow WebRequest for listed URL

2. When you using chat_id (like "-1001301234105") instead @channel_name, you will hit some error with this code so i have change it

And now I confirm after i have do two things above, this library work well in MT5.

Thanks Andrey Voytenko again.

odlambda
22
odlambda  

Right!!! Same problem!!!!



Junior:

Thanks a lot Nguyen Van Tuan,
Now, it works with private channels. Before, my bot was working only in public channels.

Best Regards,
Junior


satrifx7
10
satrifx7  
Hi

I got a script to send messages from MT4 to Telegram, I tried to convert to MQL5 but failed, through this discussion forum I ask for help to convert from MQ4 file format to MQL5 for further study material .....

the file I included


I thank those who are willing to help



odlambda
22
odlambda  

Hi, I update metatrader v and compile the code again, but report me a warning:


MT5 5.00 build: 2170 4 / OCT / 2019:

"" Obsolete behavior, calls to hidden methods will be disabled in a future version of the MQL Telegram.mqh compiler ""


The reference call to: " StringReplace "


I am looking for any alternative but for the moment I did not find it. In the future rev ..... any ideas?


Thank you!!


Code:


 //+------------------------------------------------------------------+
   void UserNameFilter( const string username_list)
     {
      m_users_filter.Clear();

       //--- parsing
       string text=StringTrim(username_list);
       if (text== "" )
         return ;

       //---
       while ( StringReplace (text, "  " , " " )> 0 );
       StringReplace (text, ";" , " " );
       StringReplace (text, "," , " " );
      

       //---
       string array[];
       int amount= StringSplit (text, ' ' ,array);
       for ( int i= 0 ; i<amount; i++)
        {
         string username=StringTrim(array[i]);
         if (username!= "" )
           {
             //--- remove first @
             if ( StringGetCharacter (username, 0 )== '@' )
               username= StringSubstr (username, 1 );

            m_users_filter.Add(username);
           }
        }

     }
   //+------------------------------------------------------------------+ 
odlambda
22
odlambda  
satrifx7:
Hi

I got a script to send messages from MT4 to Telegram, I tried to convert to MQL5 but failed, through this discussion forum I ask for help to convert from MQ4 file format to MQL5 for further study material .....

the file I included


I thank those who are willing to help



You dont needed convert the code.This code can be run in both version, see again the post or code.
Keith Watford
Moderator
24849
Keith Watford  
odlambda:

Hi, I update metatrader v and compile the code again, but report me a warning:

Please only use English in the forum.

I have edited and translated your post with the site's tool this time

odlambda
22
odlambda  
Keith Watford:

Please only use English in the forum.

I have edited and translated your post with the site's tool this time

Sorry its a translate plugin from Chrome.


Thanks and sorry.

HoangMinh891
6
HoangMinh891  

Please help me to increase ScreenShot (image) Size from 800x600 to 1920×1080 and 1660x765.

I have used size 1660x765 and hard to see number on chart but 800x600 can, then I think there is a way to increased chart size when we screenshot. Please help me to do so

Thanks!

satrifx7
10
satrifx7  
odlambda:
You dont needed convert the code.This code can be run in both version, see again the post or code.

Hi odlamda


thank you

for my post response .... I have tried, for example in MT4 when open Order Buy ... then ea will record the activity on the chart and send a message to the telegram channel regarding the buy order entry. When used on MT5, no messages are received from transactions on MT5 ... please help where the error is ...


thank you

Nicholas Martins
10
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... I tried editing the .mq5 file for new symbols, like USDINR or USDBRL (these are symbol indicators are provided with upper case letters only), they work but when I try the symbols containing lower case, something turn them into upper case letters and the query for the symbol fails because the name is wrong. The problem persists when querying for quotes or chart image, the response is slightly different but neither work with symbols that use lower case letters.

I attached some examples 

Files:
IMG_7207.PNG 449 kb
IMG_7208.PNG 435 kb
IMG_7210.PNG 773 kb
IMG_7211.PNG 810 kb
To add comments, please log in or register