OrderSelect() always returns true

 
bool mh = OrderSelect(tck, SELECT_BY_TICKET, MODE_HISTORY );
bool mt = OrderSelect(tck, SELECT_BY_TICKET, MODE_TRADES );
Print("mh: ", mh, "  mt: ", mt, "  OrderClosePrice(): ", OrderClosePrice());


That is my code.  I am running MT4 build 840. Using the history tester
What is the problem?  BOTH the 'mh', and 'mt', variables return 'true' at all times.  It does not matter whether the trade is open or closed.

 

Read the documentation

Note

The pool parameter is ignored if the order is selected by the ticket number. The ticket number is a unique order identifier. 

 
What is the problem?  BOTH the 'mh', and 'mt', variables return 'true' at all times.  It does not matter whether the trade is open or closed. There is no problem! BOTH the 'mh', and 'mt', variables will return 'true' at all times if you have a valid ticket number.  It does not matter whether the trade is open or closed, or pending or deleted.
 
MehZhure:


That is my code.  I am running MT4 build 840. Using the history tester
What is the problem?  BOTH the 'mh', and 'mt', variables return 'true' at all times.  It does not matter whether the trade is open or closed.

WHRoeder:
What is the problem?  BOTH the 'mh', and 'mt', variables return 'true' at all times.  It does not matter whether the trade is open or closed. There is no problem! BOTH the 'mh', and 'mt', variables will return 'true' at all times if you have a valid ticket number.  It does not matter whether the trade is open or closed, or pending or deleted.

Ah yes!  I did not catch that until I read further down in the "Note" section.  Thank you for pointing that out.
Reason: