I'm stumped. I'd like for an EA I am writing to check to see if a trade has not or closed, and if the trade has closed, to place ticket to 0. It does not appear to work, although I am using the following code.

If (OrderSelect(ticket,SELECT_BY_TICKET)==false)

ticket=0;


Any thoughts?