I am looking to get a random number between 3000 and 5000 that will be passed into the Sleep().
here is what I am came up with, while it works, I wanted to ask if there was a better way to get the same result.
the issue I am coming across is when I send multiple alerts to telegram and not all of them arrive, I understand that telegram will prevent 20 messages per second or per minute. therefor I need the EA to sleep for a random number of seconds between 3-5 before sending the alert. After trying just the sleep and getting blocked, I determined I need for the alert to be sent out at random within 3-5 will allow for all alerts to be delivered. I suppose the time it takes for the EA to get a number between 3000-5000 out 32767 also take into account when the alert will be sent. I suppose what I have below will work, but I did want to get a different perspective.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
All,
I am looking to get a random number between 3000 and 5000 that will be passed into the Sleep().
here is what I am came up with, while it works, I wanted to ask if there was a better way to get the same result.
the issue I am coming across is when I send multiple alerts to telegram and not all of them arrive, I understand that telegram will prevent 20 messages per second or per minute. therefor I need the EA to sleep for a random number of seconds between 3-5 before sending the alert. After trying just the sleep and getting blocked, I determined I need for the alert to be sent out at random within 3-5 will allow for all alerts to be delivered. I suppose the time it takes for the EA to get a number between 3000-5000 out 32767 also take into account when the alert will be sent. I suppose what I have below will work, but I did want to get a different perspective.