Can someone please assist me with code to delete an open Buy/Sell Stop order that has been opened for any number of bars back.
Thanks in advance,
Can someone please assist me with code to delete an open Buy/Sell Stop order that has been opened for any number of bars back.
Thanks in advance,
Int BarCount; init() /Place an order if(SignalOpen) OrderSend() BarCount = Bars; /Combine the order if(BarCount 5 lt;= Bars) OrderDelete();
@ RR; I love the quick reply. I can help you.
Originally Posted by ;Originally Posted by ;
I tried using your code and I think I am doing something wrong since the trade the next bar open with the next code is being closed by the EA. Please advise, Inserted Code for(cnt=0;cntlt;complete;cnt ) OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()lt;=OP_SELLSTOP /test for opened position OrderSymbol()==Symbol()) /test for symbol if(OrderType()==OP_BUYSTOP) /buystop position is started if(TotalOrdersMode(MagicNumber,OP_SELL) lt;= 0) if(BarCount 5 lt;= Bars) ticket = OrderDelete(OrderTicket(),Green); else/go to sellstop position if(TotalOrdersMode(MagicNumber,OP_BUY) lt;= 0) if(BarCount 5 lt;= Bars) ticket = OrderDelete(OrderTicket(),Red);Originally Posted by ;