Close All Positions Functionality

 
Question regarding MT4. Do Close All position EA's/Scripts send a single order for the total size of the open positions? Or do they ust replicate the manual process of closing orders 1 by 1? or are both possible, but depends on the code?
ie if I have 10 seperate 0.1 lot orders open in EURUSD and use a close all script, does it send 1 order for 1.0 lots or 10 orders for 0.1 lot each to close each order individually?
If it is the later case sending individual orders, are they sent 1 at a time in order? Or is it possible to send all 10 orders simultaenously? I believe I have heard the term asnychronous order, but don't fully grasp what it actually does. 

The reason I ask, I often utilize a grid style strategy, and therefore can end up with a large number of individual positions that I would like to try and close out all at once in the most efficient and quickest way possible. 

Any help or opinions on the matter would be greatly appreciated! Thankyou!!
 
NSTprop: Question regarding MT4. Do Close All position EA's/Scripts send a single order for the total size of the open positions? Or do they ust replicate the manual process of closing orders 1 by 1? or are both possible, but depends on the code? ie if I have 10 seperate 0.1 lot orders open in EURUSD and use a close all script, does it send 1 order for 1.0 lots or 10 orders for 0.1 lot each to close each order individually? If it is the later case sending individual orders, are they sent 1 at a time in order? Or is it possible to send all 10 orders simultaenously? I believe I have heard the term asnychronous order, but don't fully grasp what it actually does. The reason I ask, I often utilize a grid style strategy, and therefore can end up with a large number of individual positions that I would like to try and close out all at once in the most efficient and quickest way possible. Any help or opinions on the matter would be greatly appreciated! Thankyou!!

On MT4, each order needs be closed individually. So an EA that closes all orders, will iterate over each one to close it.

Remember that MT4 does not have positions like MT5 has. It only has Orders, be it pending orders or market orders.

EDIT: the best way to close out multiple orders in a way that "freezes" their gains (or losses) instantly, is by using the OrderCloseBy method. This method does not make closing the orders more quickly, but it does "freeze" the profit/loss, so that you can then take your time closing the orders without having to worry about the profit/loss changing while you are processing the orders. Run a search as there should be several threads about it.

OrderCloseBy - Trade Functions - MQL4 Reference
OrderCloseBy - Trade Functions - MQL4 Reference
  • docs.mql4.com
OrderCloseBy - Trade Functions - MQL4 Reference
 
Thank you very much for the reply. The explanation makes sense. I will look up OrderCloseBy!