-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. -
if(OrderSelect(openOrderID,SELECT_BY_TICKET)==true)
You select by ticket, but don't test if the ticket has already closed, been deleted, or not yet open. (Latter two are pending order types.)
If it has been closed, then you can't modify it, no such ticket open.
-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. -
You select by ticket, but don't test if the ticket has already closed, been deleted, or not yet open. (Latter two are pending order types.)
If it has been closed, then you can't modify it, no such ticket open.
Hi William,
I am sorry if I am asking stupid questions, but when the if is written this way:
if(OrderSelect(openOrderID,SELECT_BY_TICKET) && OrderCloseTime() == 0)
The tester simply assumes that the order is closed since the beginning, even when checked right after the first tick, which I really don't understand..
Is there any reason for this behavior? Could you please show me as to how to solve this issue?
Prove that.
Okay guys,
Thanks a lot for your help, I have finally been able to find and solve this issue, it was caused by incorrect placement of brackets
Stupid mistake, but hey, lesson learned :)
Anyway, thanks again

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey guys,
I am fairly new to the MT4 and just recently started writing some code.
With this code I am getting 4108 error with comment being invalid unknown ticket #.. for OrderModify, even with correct order id and so on..
I would very much appreciate any kind of help
Thanks a lot