I would just like to report that sometimes the OrderCloseTime() is returning 0 even thought the order has closed. I stress sometimes but it does happen enough to be serious. Yes I have verified the order has been selected. I printed OrderTicket() and and OrderCloseTime() to the log and it is for sure an error. I have only seen in tester but still this makes optimization difficult.
- Help!, Command, or commands to detect operation closing automatically.
- [Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2.
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
bfis108137: I printed OrderTicket() and and OrderCloseTime() to the log and it is for sure an error. | Are you checking the return value from OrderSelect? What are Function return values ? How do I use them ? - MQL4 forum |
WHRoeder:
bfis108137: I printed OrderTicket() and and OrderCloseTime() to the log and it is for sure an error. | Are you checking the return value from OrderSelect? What are Function return values ? How do I use them ? - MQL4 forum |
Well I am checking but even if I wasn't it wouldn't matter since I use the following line.
Print("t=",OrderTicket()," clsTm=",OrderCloseTime());
Just prior to that line is the line in the log notifying that the stoploss has been reached and that the order has closed and yes the ticket numbers are the same. To cement it even more I was able to search the history and found the order so that was my workaround but I have found the history not to be the most reliable thing and that orders sometimes take time to reach the history.
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