No documentation for "cannot refresh history [4073]"? How to properly handle this error? - page 3

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
There's many ways to do it, but this is how I would do it...
Ok, let's make an attempt to make this complete, so someone else can also reuse it. This is how I see the step 2:
Beside nicholishen remarks, I would not recommend this kind of approach. There is something fundamentally wrong in your reasoning, you can NOT avoid errors once for all, you have to check for error each time an error is possible. Of course that doesn't mean the above approach is wrong or will not work for your needs. But the best practice is to check for errors, always.
So to summarize this up:
To avoid error 4073 and also achieve immediate logic execution after initialization, one should use this code:
Is this the best practice?
Hi, this is an old post but I've seen this random issue (error 4073 at OnInit). You made a good point, and Carl Schreiber stated it clear to a general scope. I liked both so I just wanted to share that I've faced the need to do more sort of "initialization stuff" on top of whatever I had at OnInit. To avoid this, I just use a global variable, say "initPending". Then as Carl Schreiber proposed, inside OnTick, I take care of the pending initialization stuff.
Too bad that when INIT_FAILDED is returned by OnInit, MT4 does not retry to call OnInit after waiting a few seconds until OnInit returns INIT_SUCESSFULL