open position shows up on MODE_HISTORY

 
I have a situation where the following line:

OrderSelect(ticket, SELECT_BY_TICKET, MODE_HISTORY)

returns true when I pass it the ticket number of a trade that is a currently open position. That is not right, is it?
 
Please read the MetaEditor dictionary
===
pool - Optional order pool index. Used when the select parameter is SELECT_BY_POS. It can be any of the following values:
MODE_TRADES (default)- order selected from trading pool(opened and pending orders),
MODE_HISTORY - order selected from history pool (closed and canceled order).
===
 
palanka:
I have a situation where the following line:

OrderSelect(ticket, SELECT_BY_TICKET, MODE_HISTORY)

returns true when I pass it the ticket number of a trade that is a currently open position. That is not right, is it?
I have had some strange events with both the mode trades and mode history. It appears that its referances some how the history tap on the platform as I was able to change the out come by changes made to the dates selected for the history tab.

I ended by checking the closeing price of the order ticket numer if it was larger then zero it was closed (history). if it was zero then it was still open (current).

If you find another way arround this let me know.
 

palanka,

a more direct quote from the MetaEditor dictionary (as stringo suggested) is:

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

So, in your sample, as you are looking by ticket number, it'll find that ticket number, it doesn't care if it's history or open because it's ignoring that attribute.

Reason: