OrderSelect() always returns true

Back to topics list To post a new topic, please log in or register
avatar
6
MehZhure 2015.07.18 00:51
 
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.

avatar
Moderator
3427
GumRai 2015.07.18 01:27 #
 

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. 


avatar
13009
WHRoeder 2015.07.18 14:03 #
 
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.

avatar
6
MehZhure 2015.07.20 01:04 #
 
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.
Back to topics list  

To add comments, please log in or register