You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Well I wouldn't say it's a crutch. I'm expecting a stream of quotes from the server otherwise the history won't be updated. Another option is to take local time of computer and correct it for time zone, which can be calculated automatically and in the end wait for quotes update anyway. It's a bit crooked but I don't think Metakvotov will change anything in MT4. At the end of the day it's a server connection problem that has to be handled one way or another.
There. And you've realised that this is a problem! But, I think it should be fixed and/or the help should be supplemented with an algorithm for all cases.
The data retrieval function should not give out left-handed data without errors and warnings!
This is not my first topic (previous one was about MT5, I haven't got any clear answer about it) about synchronization and following hangs/errors.
Yes, that seems to work. As an option, it can be used. Thank you! But I would still like the functions to work properly.
It will work only if there are no missing bars - and this cannot be guaranteed. Suppose, for example, there are no new quotes on the server for the current hour (and maybe for the previous hour, too). Accordingly, the last bar is a previous one.
There are two significant errors in your approach to verification:
Igor, have you reviewed the code? Where do I get something in OnInit()?
2. What checks? Where is it written that the indicator must use OnCalculate() at least once to work correctly?
It will only work if there are no missed bars, which cannot be guaranteed. Suppose there are no new quotes on the server for the current hour (and maybe for the previous hour as well). Accordingly, the last bar is some previous bar.
This (as I said, crutch) solution is so far better than nothing. As I said (and proved), there is a bug. The sooner the developers fix it, the better.
It will only work if there are no missed bars, which cannot be guaranteed. Suppose there are no new quotes on the server for the current hour (and maybe for the previous hour as well). Therefore, the last bar is a previous bar.
So it doesn't give out any left data, it gives out the last data received and the error won't occur until the terminal starts to receive the quote stream. In your case, you are trying to receive data before the quotes start. As well as any connection failure. What is the problem with MT5?
Oh, man... We're already past that point. See your own log:
Sequence. First we check the connection. Once the connection is established, we get the time. Explain to me, please, why the hell is error 4066 returned first and then it's not returned!? What has changed in 20ms since the last call?
What's the problem with MT5 there very interesting to read?
https://www.mql5.com/ru/forum/219829
This (as I said, crutch) solution is so far better than nothing. As I said (and proved), there is a bug. The sooner the developers fix it, the better.
Oh, man... We're already past that point. See your own log:
Sequence. First we check the connection. Once the connection is established, we get the time. Explain to me, please, why the hell is error 4066 returned first and then it's not returned!? What has changed in 20ms since the last call?