Close all trades depending on profit
-
Hello.
If I run EA on few currencies, is it possible to set-up a "close all trades" depending on profit on the total of all trades running?Thanks!!
-
-
Yes, I got it, but can't find the condition, example, if I have 10 open trades and I want to close all trades when the profit running reach 100$, how can I do it?
-
Try this http://prntscr.com/9kngyq
http://i.imgur.com/Xbpzuo2.png
It checks the profit from a group of trades. -
Ok, thank you very, it's very helpful!
Now, that it works very well for a single pair, if I would like to close all trades (example trades in 5 pairs) of the account when I reach a target, is there a way to do it? And if so, is it possible to program it with % of the balance?
Thank you very much again!
-
You can also try something like this http://prntscr.com/9mmryd
http://i.imgur.com/m1FHrOW.png
The first block selects a group of trades that match the filter settings. Then for all of them in "Condition" some parameter is calculated (in this case, their total profit) and can be compared with something else. In the first block you can filter trades by "Group", if you work with groups. You can try with value like "1, 2, 3" which should filter all trades with groups 1 or 2 or 3. Or, you can try with market name as "EURUSD, GBPUSD" which should select only trades from EURUSD or GBPUSD. By default all blocks including this one are set up to filter trades with group 0 and market name as the one of the chart. -
Thank you very much, it works!

-
Hi.
I can't find the way to do the opposite, if I would like to close all trades but with loss count? Example 10% of the account?Thanks!
-
Just do some basic math. What you have now is this:
Is Total Profit > Balance * 0.2 ?
What about this:
Is Total Profit *(-1) > Balance * 0.1
If the profit is positive, it will be turned into negative and there is no chance to be bigger than any positive value. When it's negative it will be turned into positive and it can be compared (with ">") with any positive value.