But I want to close ALL trades if the account is in profit. So if I have 5 trades and 3 of them are at 5 dollar profit and I have 2 trades that are open with 1 dollar loss each. Then the total profit is 3 dollar profit. I want the EA to close all open trades then, since the account is in a total profit. Not just closing the ones in profit.
No matter if they have the same MagicNumber or opened by another EA or another currency pair. If my open trades all together have reached a certain profit I want to close even the ones going wrong.
It would be even better if I could put a trailing stop on all trades, so they can continue if they go in the right direction.




