I need some information:
You can attach the same EA on more than one chart. Each EA will be triggered with the incoming tick on the chart on which it's attached independent of ticks on other charts. The only conflict I'm aware of is that two EA's may not execute trades simultaneously. For solutions, click here:
Almost it works, no problems in attaching the same EA on multiple charts, it depend on the EA itself, mean if the EA uses Symbol name or magic numbers in its orders,
second there is no problem setup the same MT4 in different directories.
Yeah, or u can just copy MT4 folder contents to another folder (no need to re-install). Note that if u log on to the same account from 2 different Terminals and run an EA on each, u still need them to have different magic numbers (assuming they are designed to use magic numbers in a multi-EA environment). In this case they would have no problem interacting with the server at the SAME time (opening orders, closing orders, etc.) .
Thanks all for answer.
To better understand I need more information.
If I use one metatrade client terminal and two charts with different Symbol If I copy the same EA twice and name the first one EAEurUsd and the second one EAUsdChf and attach the first to EurUsd chart and the second to UsdChf chart
You don't need to rename the EAs.
Regarding the use of magic numbers. If you can answer yes to all of the following:
- you have the EA attached to different pairs
- the EA only deals in orders for the native pair of the chart on which it has been attached
- no other EAs are dealing in orders for these pairs under the same account number
then you don't need to implement magic numbers and your EA may check for its own orders by simply checking that OrderSymbol() == Symbol().
Regarding your need to handle the potential for "Trade Context Busy":
In the above implementation, yes, you WILL need to handle this scenario. The reason is that each instance of the terminal represents a single Trade Context. Therefore, EAs will contend for use of this Trade Context (for TRADING functions only) and conflict is obviously more likely to happen when 2 EAs behave in a similar manner. You are implementing exactly the same EA on both charts, so on the surface, it would seem likely that they may both attempt to execute trading functions at the same time. However, due to their use on different pairs, or due to some parameters on your EAs, this may not be the case. Only you can tell. Bottom line - if you are running multiple EAs in the same terminal instance, then code in the logic to detect and handle Trade Context Busy properly.
I can answer yes to all your question.
Last question: If I use 2 different terminal on two different chart (with same login broker account) I don't worry for "Trade Context Busy" because I can place market order at the same time? Is it correct?
That is correct.
Does this scenario also mean that the use of magic numbers is not required since each EA attached to a different currency chart on different MT4 Terminals will only open and close trades according to their native Symbol() they are attached to?
Read CB's first answer in this thread.
To add comments, please log in or register