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

 
OrelMely:

Thanks for your help !!

I dont know about code , i hope someone can kindly help ...

My logic tell me there is a call about Chartopen , and maybe a need to change to some functions similar to full windows or similar ?

if someone can provide me some lines about where i need to check all the possible functions would be really appreciated .

It's not "fix some lines".

You need to make several screens, wait till they are ready, and send them all using SendMediaGroup function (you have to write it from the scratch).

Try to find someone in Freelance.

 

Thanks  Andrey !!!


Have a nice week

 

Hello Everyone!!
Can i know if there is any easy way to get different template buttons according to the chosen time frame?


Thanks!!

 
OrelMely:

Hello Everyone!!
Can i know if there is any easy way to get different template buttons according to the chosen time frame?


Thanks!!

Yes the easy way is to go here.

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
I want a simple RSI based Expert Advisor that buys or sells when it hits the RSI and takes the profit or loss as a percentage. I made a sheet with all the conditions. If you are interested, please leave me a message and I will send you the detailed sheet 1. I want you to include buy arrows (green) and sell arrow (red) based on custom levels...
 

[SOLVED] "UNKNOWN ERROR 1001"

Time Synchronization

If client time diverges widely from server time, a server may start ignoring client messages, or vice versa, because of an invalid message identifier (which is closely related to creation time). Under these circumstances, the server will send the client a special message containing the correct time and a certain 128-bit salt (either explicitly provided by the client in a special RPC synchronization request or equal to the key of the latest message received from the client during the current session). This message could be the first one in a container that includes other messages (if the time discrepancy is significant but does not as yet result in the client’s messages being ignored).

Having received such a message or a container holding it, the client first performs a time synchronization (in effect, simply storing the difference between the server’s time and its own to be able to compute the “correct” time in the future) and then verifies that the message identifiers for correctness.

Where a correction has been neglected, the client will have to generate a new session to assure the monotonicity of message identifiers.

Above quote is from https://core.telegram.org/mtproto


I found a problems when we have many devices, the times on each Telegram device maybe don't have the same.

Then i sync my PC time zone  exactly with Mobile time.

After that, i don't see this bug anymore.


-> This is my solution. I don't know if it work for you. It just a hint.

Hope you guys can solve this bug soon! 

 
Andrey Voytenko:

ok. But if you are working with a private channel, use the Channel ID, not the Channel Name.

Hey guys! Hello Andrey, I've been using the telegram signal EA for a couple of months now, but on a public channel. Now I'm trying to put in a private channel and reading about it here seems the setup is different:

You mean:

- Instead o putting the channel name, I put the Channel ID ( I  got the channel ID fowarding a channel message to the @getidsbot on telegram, ifanyones wondering)


Like this?

//--- input parameters
input string InpChannelName="1234567898763";//Channel Name (here i changed the name of the public channel to the Channel ID (because the public channel is now private) , is this correct?)
input string InpToken="9999995551:AAGKxSgx45asdcvft9DSr0Yp7HB98klU1r0";//Token


In advance: Thank you, learned a ton by reading this thread here.

 
Joao Lucas Silva Penido:

Hey guys! Hello Andrey, I've been using the telegram signal EA for a couple of months now, but on a public channel. Now I'm trying to put in a private channel and reading about it here seems the setup is different:

You mean:

- Instead o putting the channel name, I put the Channel ID ( I  got the channel ID fowarding a channel message to the @getidsbot on telegram, ifanyones wondering)


Like this?


In advance: Thank you, learned a ton by reading this thread here.

Telegram.mqh on line 980 calls for:

int               SendMessage(const long    _chat_id,
                                 const string  _text,
                                 const string  _reply_markup=NULL,
                                 const bool    _as_HTML=false,
                                 const bool    _silently=false)

and in line 1006 calls for:

int               SendMessage(const string _channel_name,
                                 const string _text,
                                 const bool   _as_HTML=false,
                                 const bool   _silently=false)

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

int res=bot.SendMessage(InpChatId,msg);
            if(res!=0)
               Print("Error: ",GetErrorDescription(res));

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!

 

hi 

I have done adding the address "https://api.telegram.org" in EA tools, but I am still getting the error of url does not allowed for webrequest, why is that please?

I am just trying to use the example EA, which is the TelegramAlertMT4 from https://github.com/sholafalana/MT5-MT4-Telegram-API-Bot

I have copied the 4 files from include to include, and paste the TelegramAlertMT4.mq4 into indicator folder, compiled with no error.

If I put it under EA folder and run it, I never get the smily face, even though i have enabled auto trading.

Many thanks

 
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!");
 

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