New EA to close trades opened by a different EA?
-
I have an EA that has correctly opened some trades. The magic number is say 200010. There could be a number of trades open using group numbers so that there is say 3 trades with magic numbers of 200010, 200011 and 200012.
Can I add a new EA on a different chart of the same currency that will close the trades from the first EA when certain conditions are met? If so what magic number should I use for the new EA? Do I also use 200010? The trade I open with this EA should I use group 3 so that it's magic number is 200013?
When I close the trades from the new EA I also want it to close the trades of the first EA. When the conditions are met on EA 2 do I simply use block Close Trades with Group numbers entered of 0,1,2,3?
-
yes you can manage trades with another EA, and yes, magic must match.
When EA with magic 1000 opened trade in group 1, magic of this trade is 1001.
Another EA can have magic 1000 and manage (close) trade with group 1 (and 1001 trade will be managed).
Or you can also manage this trade using EA with magic 1001 directly, but in that case must be group 0 (or empty) ... -
Thanks Miro