incorrect to delete pending orders?

 
for(i=OrdersTotal()-1; i >=0 ; i--)
                     {if(OrderSelect(i, SELECT_BY_POS,MODE_TRADES)==true)
                        
                         {if ((OrderType() == ((OP_BUYSTOP) ||(OP_SELLSTOP))))
                        OrderDelete(OrderTicket());
                         }
                     }
i get invalid ticket error. why so?
 

It is because the operation (OP_BUYSTOP) ||(OP_SELLSTOP) evalues to OP_SELL. 

 
yuan83:
i get invalid ticket error. why so?
Why do a double posts ? You open a thread and you do not even look at the answers ?
 
We just went through this several days ago with you.

Don't double post

 
yuan83:
i get invalid ticket error. why so?


Looks like you wanted to get it

In more then a year your learning isn't making any progress...

Read your own topics again before you bother us with questions you asked before

you can find them here   https://forum.mql4.com/en/author/yuan83 

Reason: