Close all the pending order when 1 pending order is hit.

 
Recently, I have bought an EA that would place a lot of pending orders up and below the current price when it considers the price is the turning point. But I would like after the EA hit the first pending order, it can cancel put other pending order because I want to combine the EA with the hedging strategy. However, there is no option in the EA for me to achieve this goal which always needs me to turn off the EA after it hits the first pending order and closes the other pending order manually. Is there anyone can teach me how to do it and give some insight. Thanks a lot !!!!!!!!!!!!!!
 
maxyu2325:
Recently, I have bought an EA that would place a lot of pending orders up and below the current price when it considers the price is the turning point. But I would like after the EA hit the first pending order, it can cancel put other pending order because I want to combine the EA with the hedging strategy. However, there is no option in the EA for me to achieve this goal which always needs me to turn off the EA after it hits the first pending order and closes the other pending order manually. Is there anyone can teach me how to do it and give some insight. Thanks a lot !!!!!!!!!!!!!!

 if mq4, you can  delete that via adding OrderDelete() .