The Expert Advisor closes all open positions when the specified amount of profit or loss in the deposit currency is reached.
The Expert Advisor works on the pair it is thrown on or on all the instruments of the account, depending on the variable AllSymbol.
As soon as the total profit on all positions (if Allsymbols = true, then the entire account, if AllSymbol = false, then only orders of the current currency pair) reaches the ProfitClose level (in the deposit currency), then all orders will be closed.

ProfitClose = 10; – close all orders when receiving a profit (in the deposit currency)
LossClose = 1000; – close all orders when a loss is received (in the deposit currency)
AllSymbol = false; – take into account all tools or only the one that the EA is based on
AllMagik = false; – consider all magics or only those specified in the Magik variable
Magik = “0,1,2,3,4,5” – specify which magics to control, if AllMagik=true, then all;
DeleteOrders = true; – delete pending orders


There are several expert advisors working on Your account. They opened many orders in different currencies. As soon as the total profit on the account reaches $ 10 (set in the parameters) or the loss reaches $ 1000, all orders will be closed.

The EA is written for MT4 and MT5. You can download and use it for free without restriction on any accounts. Regarding the introduction of additional functions, please contact me at the following addresses:

Cm CloseProfit
Cm CloseProfit
17.7 KiB
Cm CloseProfit
Cm CloseProfit
21.5 KiB