Question about OrderSelect()?
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)==true) { Print("function " + ticket); }
MODE_TRADES is ignored if you select by ticket.
If you only want to work with the trade when it is open
if(OrderSelect(ticket,SELECT_BY_TICKET) && OrderCloseTime()==0)
Thank you for your helpful explanation, GumRai! :)
could anyone be so kind to help me understand the OrderSelect() function?
When I load this sample EA an order opens and the two Print function start and keep printing. When I then close the trade by hand I thought OrderSelect() by ticket in MODE_TRADES ("order selected from trading pool(opened and pending orders)") should turn false, but it does not. I thought when I close the order it is shifted into history and can then only be accessed by MODE_HISTORY, but it seems not.
I wonder how to tell an EA to stop doing something in the OnTick, if not by OrderSelect.
Thanks you!