OrderCloseTime bug

 
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.
 
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.
 
It does matter.
  1. If your select fails, you can't call those functions and anything you get is meaningless.
  2. Just because you see in the log that the order closed, doesn't mean OrderCloseTime() has been updated. You must reselect to see the current value.
Reason: