How to run the same EA on two metatraders?
-
I have the same EA running on two Metatrader's installed in two different folders.
I would like to run the same EA, same active and same account, but have different parameters and should have different behaviors. My EA is set to run only one operation at a time, but I thought the Magic Number would know them differently and I would have two orders running at the same time, one for each magic number. How to configure? -
No need for 2 instances of MT4, if you run them on the same account. Just use 1 MT4 and run on 2 charts of the same instrument (like for example 2 charts of EURUSD 5 min) and put your EA on both the charts, but with a different Magic Number. For example on chart1 MN: 1234 and on chart2 MN: 6789. The EAs, even when exactly the same on both charts, will leave each others trades in peace.
One big disadvantage is however , that the "Detailed Report" of MT4 can not sort the trades per EA (magic number). So you get a report with the trades of both EAs mixed through each other in chronological order. For this reason I test my EAs on different instances of MT4 , but on DIFFERENT ACCOUNTS. In this way I can plot a chart per EA.

-
Did not work. It opens only one position. Would not it be because I have the "no position"?
-
My assumption was that if you ran the same EA on 2 charts with different magic numbers, but used the "no trade" exists block, then the EA would check your account and see there was a trade already in existence despite it being produced by the EA with a different magic number because the account is a singular entity. I may be wrong on this.
If I'm right then you could get round this by having each EA keep track of what's going on with the chart rather than the account. When the "buy now" block is executed it could add 1 to a variable so you know a trade exists, subtract 1 when closed. More complicated with SL and TP because a block isn't passed when these occur, perhaps look at current objects on the chart...
-
https://fxdreema.com/help/working-with/magic-start-and-groups
There will be an other reason why the EA does not trade. We can even give trades from the same EA a different MN by using the Group Number (the upper parameter you find in every block). -
Interesting, so each trade must have the magic number attached to the order number somehow but we can't see this. Useful to know.