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

 
Andrey Vasilenko:
Good afternoon. No access to telegram api url, error 1001. The question has already been raised here, who had such a problem and who was able to solve it, share please

Switch to Win10

 
Thanks for the reply. Did it really help or just a guess? The client has Win 7, it's a bit out of hand to ask to upgrade to Win 10, the vps will have a different vin too.
 
Andrey Vasilenko:
Thanks for the reply. Did it really help or just a guess? The client has Win 7, it's a bit out of hand to ask to upgrade to Win 10, the vps will have a different vin too.

There is no guarantee, we have to check. But a lot of people complained on W7 and on W10 reported that everything works. Try it out for yourself. I wouldn't change for telegram either.

 
Thanks, it helped ) Switching from Win7 to Win10 solved the problem
 
Ricardo Andres Moscoloni:

Telegram.mqh on line 980 calls for:

and in line 1006 calls for:

for sending a message to a private channel i have to pourposely define chat_id as a long like this:

input long InpChatId= -(use h t t p s ://t.me/username_to_id_bot to obtain your private chat id); // Chat ID Private

and use it to cast to telegram

otherwise it will not work, if someone knows a code to identify when we use an string @publicChannelName or a long -privateChannelName  to cast acordinglly please post it here!

Private channel Ids have negative values. Do this:
input ulong channelId = -1097657894777;
input string channelName = "@electronicsfreak";

bot.SendMessage (channelId, "Hello you!");
bot.SendMessage (channelName, "Hello you!");
 
Andrey Vasilenko:
Thanks, it helped ) Switching from Win7 to Win10 solved the problem

It doesn't work on Win7, you don't even have to try. I tried all the options. Built in MQL WebRequest() and the one on Windows. You need Windows 10 or Windows Server 2012 and higher.

 

I've implemented a Telegram screenshot post-to-telegram for confirmation functionality for my multi currency multi timeframe EA all good.

  void              send_photo(CMyBot & ibot, string symbol, string type, string shortTF, string longTF)
     {
      string photo_id = ScreenShotToFile(symbol, type,  shortTF,  longTF);
      int chat_id = **********;
      string caption = photo_id;
      StringReplace(caption, ".png", "");
      string enter = StringFormat("/%s", caption);
      int sent =  ibot.SendPhoto(photo_id, chat_id,  photo_id, enter, NULL, false, 10000);
      PrintFormat("Sent %i", sent);
      //--- start or help commands
      //  ibot.SendMessage(chat_id, "Click on the buttons", ibot.inlineKeyBoardMarkup());
     }

Telegram Post

I Can also send an inlineKeyboard with the Telegram.mqh SendMessage() function all good

 ibot.SendMessage(chat_id, "Click on the buttons", ibot.inlineKeyBoardMarkup());

Inline Keyboard

I would prefer the sendPhoto() took an inlineKeybourd, but for some reason SendPhoto() only accepts the standard KeyBoardMarkup(), not the inlineKeyBoardMarkup() in the "reply_markup" 

I've been hacking at the Telegram.mqh but can't seem to get this to function.

Any help would be appreciated

 

Hello,  is it possible to get the daily Profit in percent instead of the account Balance ?

any advice would be appreciated . 

in the attached screenshot you can see the code . 

best regards 

 
Audiamant:

Hello,  is it possible to get the daily Profit in percent instead of the account Balance ?

any advice would be appreciated . 

in the attached screenshot you can see the code . 

best regards 

Yes it it possible, 
1. Check current balance 
2. Check daily profit (both wins n losses) 
3. Subtract from current balance u get daily_initial balance 
4. Daily_Profit/daily_initial this gives is the fraction that if multiplied by 100 u get percentage 
 

hi guys , i have run 10 Experts, and get this error in all of them

How to fix this error ?


{"ok":false,"error_code":409,"description":"Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"}