How can I close all buying/selling order?

 
Let say I have 3 sell orders currently running. Which command should I use to close them all? OrderClose() ?
 
nguye235: Let say I have 3 sell orders currently running. Which command should I use to close them all? OrderClose() ?
Yes use OrderClose() x 3.
 
But for Order Close, it ask for specific number of the opened ticket. how can I get this number?
 
nguye235:
But for Order Close, it ask for specific number of the opened ticket. how can I get this number?
Loop through the Orders one by one, OrderSelect() each and then you can use OrderTicket() to get the ticket number.
 
nguye235:
Let say I have 3 sell orders currently running. Which command should I use to close them all? OrderClose() ?

Use the order 3 to close the sell and buy.
Reason: