The function selects an order for further processing. It returns TRUE if the function
succeeds. It returns FALSE if the function fails. To get the error information,
one has to call the GetLastError() function.
But - OrderSelect() is listed as one of these other functions "Other functions never change the last_error variable value." in docs
"MQL4 Reference - Program Run - Runtime errors"
There is something not right here, yes?
1. Can it be explained
2. If production EA code relies on GetLastError() then I would appreciate comments as to how I can compensate for what appears to
be misleading MQL4 documentation.
Thanks
BTW - much of EA source code one sees hardly everassumes that Terminal might happen to return error status.
I am nervous about not callingGetLastError()every time there is even an hint that something is not right! I would like to plug those holes which could cost me money IF the EA or Client Terminal or Trade Server goes belly up. Is this an unreasonable
way to think???
1. How do other (yours for instance :) fully automatic EA's deal with the unexpected ?
2. What preventative measures do you use to allow at least a graceful degregation should the proverbial hit the fan ?
3. Just how does one qualify just what one should be testing for and when - basically, one's level of paranoia ;-)
For instance, do you use [when required/obvious]:
Alert(),
Comment()
Print()
OrderPrint()
retry loops were appropriate
Terminal GlobalVariable state so that EA will not run untill manual intervention occurs
combinations of above and/or other methods...
All this concerns me greatly because a fully automatic EA must be self sufficient, yes?
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.
But - OrderSelect() is listed as one of these other functions "Other functions never change the last_error variable value." in docs "MQL4 Reference - Program Run - Runtime errors"
There is something not right here, yes?
1. Can it be explained
2. If production EA code relies on GetLastError() then I would appreciate comments as to how I can compensate for what appears to be misleading MQL4 documentation.
Thanks
BTW - much of EA source code one sees hardly ever assumes that Terminal might happen to return error status.
I am nervous about not calling GetLastError() every time there is even an hint that something is not right! I would like to plug those holes which could cost me money IF the EA or Client Terminal or Trade Server goes belly up. Is this an unreasonable way to think???
1. How do other (yours for instance :) fully automatic EA's deal with the unexpected ?
2. What preventative measures do you use to allow at least a graceful degregation should the proverbial hit the fan ?
3. Just how does one qualify just what one should be testing for and when - basically, one's level of paranoia ;-)
For instance, do you use [when required/obvious]: