I have got an EA which can be set to handle an order. When it shuts the order, it continues looking each tick, and gives the error awake. Is there a command detach itself once its job is completed or to make it disable?
Thanks.
I have got an EA which can be set to handle an order. When it shuts the order, it continues looking each tick, and gives the error awake. Is there a command detach itself once its job is completed or to make it disable?
Thanks.
HiOriginally Posted by ;
use code such as this
for(int I=0;ilt;OrdersTotal();I )
if(OrderSelect(I,SELECT_BY_POS,MODE_TRADES)==false ) break;
put here the code to operate if there are open orders
To answer your question specifically, no one can not shut off an EA via code.
Some decent choices are:Check to find out whether the order is present and return if it doesn't (which is just another flavor of the solution offered from Mtav). Once the order is closed, trip a variable indiing that there is nothing else to do.