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

 
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! 

 

Dear forum members, please tell me how to solve this problem

{"ok":false, "error_code":409, "description": "Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"} Who has encountered this? Where to dig, what to look at.

 
Sergey Kasirenko:

Dear forum members, please tell me how to solve this problem

{"ok":false, "error_code":409, "description": "Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"} Who has encountered this? Where to dig, what to look at.

Do you have more than one indicator running or an Expert Advisor with the same bot?
 
Aleksei Beliakov:
Do you have more than one indicator running or an EA with the same bot?

Yes, I have several terminals, and the task is to get these terminals the same signal from the bot, and how to be?

 
Sergey Kasirenko:

Yes I have several terminals, and the task is to get these terminals the same signal from the bot, and how to be?

You can receive one of them and send signals to the others via a file (there are such copiers in kodobase, I think).

 
Yevhenii Levchenko:

It is possible to receive one and send signals to the other via a file (there are such copiers in kodobase, I think).

The thing is that something is on the server, something on the vps, something on the work machine, and I want to do it via Telegram, for practice, so to speak, it's interesting. And I stumbled when I tried to receive it all on several terminals, with one terminal there are no problems, it receives and sends, everything is as it should be, of course, you can cancel the marking that the message has been received and thus, even despite the error, the Expert Advisor will sooner or later receive the message, and you can filter out dubbing, but it's all a dance with a tambourine, surely there is some beautiful solution. Or a general approach to organise such a mechanism of communication between Telegram and terminals.

 
Sergey Kasirenko:

The thing is that something is on the server, something on the vps, something on the work machine, and I still want to somehow through Telegram, for practice, so to speak, it's interesting. And I stumbled when I tried to receive it all on several terminals, with one terminal there are no problems, it receives and sends, everything is as it should be, of course, you can cancel the marking that the message has been received and thus, even despite the error, the Expert Advisor will sooner or later receive the message, and you can filter out dubbing, but it's all a dance with a tambourine, surely there is some beautiful solution. Or a general approach to organise such a mechanism of communication between Telegram and terminals.

You can set up a channel for each terminal and send messages there...

 
Yevhenii Levchenko:

You can set up a separate channel for each terminal and send messages there....

Can you elaborate a bit more, i.e. each terminal has its own chat bot?

 
Sergey Kasirenko:

Can you elaborate a bit more, i.e. each terminal has a separate chat bot?

Nope. One bot. Each terminal has its own telegram channel. There you can send by channel ID. This is how I sent a picture to the channel:

if(ChannelID != 0) {
  result = bot.SendPhoto(photo_id, ChannelID, filename, filename);
}

Collect channel IDs in an array and send messages to these channels by them. To find out the channel ID, send a message from the channel to the Get My ID bot (or any other you can find) .....