How to immediately close all orders?

 
Hi Traders!
I am beginning programmer in mq4 and I would like to ask you to help me, if possible.
I would like to implement into my EA small function who can immediately close ALL orders (buys, sells, buystop, selllimit, ...) with different currency pairs? This "multi-closing" can be iniciated f.e. by condition where AccoutProfit > anyvalue.
Thanx in advance for your help :-)
Datel
 
Datel wrote >>
Hi Traders!
I am beginning programmer in mq4 and I would like to ask you to help me, if possible.
I would like to implement into my EA small function who can immediately close ALL orders (buys, sells, buystop, selllimit, ...) with different currency pairs? This "multi-closing" can be iniciated f.e. by condition where AccoutProfit > anyvalue.
Thanx in advance for your help :-)
Datel




Have a look here:

https://www.mql5.com/en/code/8602

 
fatcheese:


Have a look here:

https://www.mql5.com/en/code/8602


Hi fatcheese,
thank you! :-)
Datel
Reason: