
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
And it's not unconditional zeroing but only if last_error_fifo == 0. In short, it's the same as eggs in profile. check what the function returned before checking for errors.
Develop the topic.
Exactly for you, see :
OrderSend() termination options;
1. No error. You still call GetLastError() - in principle it's OK if the previous error is read, processed and reset.
IMHO - you don't have to.
2. There is an error - when calling GetLastError (), as far as I understand, you analyze one single error, although there may be many of them.
IMHO, it is more correct:
The last one is ErrReaction(err) - this is error handling.
For example, like this :
The processing function divides the errors into "fixable" and "unrecoverable" - the "fixable" one tries to eliminate, the code of the unrecoverable one returns back - for processing in an external (calling) procedure.
Well anyway my cockroaches are cooler because there is no need to check what each function returned so the code looks better... plus you can organise your own error codes.
plus you can organise your own error codes.
we somehow have enough to make our own as well.
It depends on your logic. After all, you can do processing of every error, and you can do only those which are important in this situation.
It is desirable, of course, to have a function for processing all of the most significant errors, and then the logic inherent in the Expert Advisor will "adjust" the priorities.
Separately, I apologize to the topicstarter if my question leads away from the main direction of the topic.
We somehow have enough to make our own as well.
Who do the inventors of MQL5 try so hard to create SetUserError... they reserved as many as 65535 error codes for themselves, and anything above that is ok, you can arrange your own :)
Just for you, see :
2. There is an error - when calling GetLastError () as far as I understand you analyze one single error, although there may be many.
IMHO - more correct variant:
The last one is ErrReaction(err) - this is error handling.
vit46:
Ознакомьтесь с этим материалом. imho, не повредит.
https://www.mql5.com/ru/forum/131373
It is desirable, of course, to have a function for processing all the most significant errors, and then the logic inherent in the Expert Advisor will "correct" the priorities.
For example, I believe that it is enough to try to open an order 5 times and then to stop trying, while you may think that you need to open an order 20 times or "to win".
I, for example, think it is enough to try to open an order 5 times and then stop trying, but you may think you have to try 20 times or open "until you win".
No, I am not counting anything. I do not have my own firm and unambiguous opinion, which is why I am asking you to recommend the most decent error-correcting feature.