Cancel or delete a pending stop order

 
Hi. I put in a buy stop above the current price and a sell stop below the current price. Once one of them gets hit, I would like to cancel the other one. How do I do this?

Thanks.
 
Cornelius127, you could try something like that :

int delorderstop()
{
int i;
for(i=0;i<OrderTotal();i++)
{
if(OrderSelect(i, SELECT_BY_POS)==true)
//OP_BUYSTOP 4 Buy stop pending position.
//OP_SELLSTOP 5 Sell stop pending position.

if(OrderType()>3)
{
OrderDelete(OrderTicket());
return(1);
}
}
return(0);
}

Reason: