Hello traders,
need help with my EA coding. I need to detele the pending order after the activation of one.
I have given two pending orders SELLSTOP and BUYSTOP after activation of one of them I need to delete the reverse pending order.
Big thanks for reply and answers. Have a nice weekend.
hewi
need help with my EA coding. I need to detele the pending order after the activation of one.
I have given two pending orders SELLSTOP and BUYSTOP after activation of one of them I need to delete the reverse pending order.
Inserted Code
int long= -1; int short= -1; int noactiveorder = true; for(s = 0; s < total; s++) { OrderSelect(s, SELECT_BY_POS, MODE_TRADES); if(OrderSymbol()==Symbol() && OrderMagicNumber() == magic) { if(OrderType() == OP_BUYSTOP) long= OrderTicket(); if(OrderType() == OP_SELLSTOP) short= OrderTicket(); if(OrderType() == OP_BUY || OrderType() == OP_SELL) noactiveorder= false; } } if(short == -1 && long != -1) OrderDelete(long); if(long == -1 && short != -1) OrderDelete(short);
Big thanks for reply and answers. Have a nice weekend.
hewi