MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
MetaTrader Market - the place where newest trading robots appear

Multiple EA, multiple MetaTrader and Multiple chart...

Back to topics list To post a new topic, please log in or register
avatar
23
davidze 2010.02.19 15:03
 

Hi all,

I need some information:

  • If I have one metatrader client terminal e 2 chart (Eurusd and UsdChf)
  • is it possibile attach the same EA on 2 chart?
  • One tick arrives on first chart (Eurusd) and, after a few milliseconds, a tick arrives on the second chart (UsdChf). If the tick on second chart arrives when the EA on first chart is running, The EA on the second chart does not "see" the tick or also the second EA runs concurrently with the first?
  • If I want open more concurrently metatrader client terminal session what should I do? Install, with the same metatrader setup, on different folder (C:\program\mt_1, C:\program\mt_2...)?

Thanks

 
Gold: Russia's diversification strategy?

Gold: Russia's diversification strategy?

The IMF’s latest international gold reserves data, updated yesterday, shows that in July, Russia raised its official gold reserves to 35.5 million ounces (1,104 tonnes). This confirms data released last week by the Central Bank of the Russian Federation, which reported an increase of over 300,000 ounces from June’s 35.

avatar
48
joetrader 2010.02.19 17:19 #
 

David -

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:

http://articles.mql4.com/141

 
avatar
72
tiodaronzi 2010.02.19 17:47 #
 

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.

 
avatar
9551
avatar
Moderator
2029
gordon 2010.02.20 04:45 #
 
davidze:
  • If I want open more concurrently metatrader client terminal session what should I do? Install, with the same metatrader setup, on different folder (C:\program\mt_1, C:\program\mt_2...)?

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.) .

 
avatar
23
davidze 2010.02.22 18:59 #
 

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

  • I need magic number or two Ea work separately?
  • I can place on market two contemporary orders or the second attempt order "see" the server is busy?

Thanks

 
avatar
1397
cloudbreaker 2010.02.22 21:39 #
 
davidze:

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

  • I need magic number or two Ea work separately?
  • I can place on market two contemporary orders or the second attempt order "see" the server is busy?

Thanks

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.


CB.

 
avatar
23
davidze 2010.02.22 23:12 #
 

Thanks cloudbreaker.

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?


Thankyou

 
avatar
1397
cloudbreaker 2010.02.23 01:36 #
 
davidze:

Thanks cloudbreaker.

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?


Thankyou

That is correct.


CB

avatar
3
mindreality 2010.07.06 22:19 #
 

Hi,

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?

 
avatar
Moderator
2029
gordon 2010.07.07 02:32 #
 
mindreality:

Hi,

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.

Back to topics list  

To add comments, please log in or register