One EA, multiple currencies, one Terminal

 

Hello Folks,


Just one fast question - I couldn't find the answer here. I wonder if it's too stupid...

If I write an EA and want to use it on different currencies at the same time in the same terminal - Do I have to pay attention to something specific or does this always work without complications?


Thank you in advance.

WorstCases

 

You can do it.

All the MQL functions that start with "i" -- like iClose(), iTime(), etc.. can draw data from any pair any timeframe.

"Do I have to pay attention to something specific or does this always work without complications?"

Uh, the code you write will do what you specify and nothing else, so 'yes' and 'not necessarily' are the answers to your question.

 
First of all, ticks do not come at the same time on different symbols, you must teach your expert to analyze charts taking this factor into account. Secondly, digit, point, stop level values are different for different symbols... So, you have to pay attention to everything rather then to smth)))
 

You can also attach the same EA to multiple charts simultaneously. Has its own set of caveats that come into play regarding trade_context and global variables but it is quite easy to deal with.

 

Thanks for all your replies.


Maybe I was not clear enough.

I'm really at the first stage trying to program some stuff, so I don't care about code which will work on other charts than the one on which it's currently loaded.

My code within the EA will only look at the current Symbol (Symbol()).


What I just want to find out is if it's a potential trouble maker if I use the same EA on multiple charts (let's say EURUSD; USDJPY) at the same time.


Thanks.

WorstCases

 

I can recommend you to ask Uriel Katz at http://www.forex-robots.com, he is an expert on robots and will give you a valid answer for sure.

It's free to ask, so no worries :)

 

"What I just want to find out is if it's a potential trouble maker if I use the same EA on multiple charts (let's say EURUSD; USDJPY) at the same time."

It depends entirely on how the code is written.

You'll have to check (at the minimum) that the OrderSymbol() matches the chart before closing an order or using its data to make decisions.

 
WorstCases:

Hello Folks,


Just one fast question - I couldn't find the answer here. I wonder if it's too stupid...

If I write an EA and want to use it on different currencies at the same time in the same terminal - Do I have to pay attention to something specific or does this always work without complications?


Thank you in advance.

WorstCases

I have an EA that operates on multiple currencies on the same terminal. You definitely have to take the following into consideration:


1) For any pair with JPY (e.g. USDJPY), .01 (2nd decimal place of price) is one pip. For all other pairs without JPY (AUDUSD), .0001 (4th decimal place of price) is one pip. This is important for setting stop loss and take profit prices, setting allowable order price slippage, or for performing any price-related calculations.


2) I have a parameter that let's me control the max # of open positions across all open windows on the same terminal. In other words, let's say my EA is attached to 10 windows. If this parameter is set to 4, it will only open no more than 4 positions across all the windows. However, you have to be careful. 5 open trades could mean 5 losing trades.


3) Warning: Be careful NOT to open trades on pairs that are positively correlated (e.g. EURUSD, GBPUSD) that tend to move in the same direction. Be careful NOT to open trades on pairs that are negatively correlated (AUDUSD, USDCAD) that tend to move in the opposite direction. In my experience, new EAs tend to lose big rather win big until all the kinks are worked out. It takes time to develop a good EA, so be patient.


4) I have another parameter that let's me control what currencies I can and cannot trade. That way, if I accidentally attach my EA to a pair I absolutely don't want to trade, the EA will generate an alert.


5) This is a nice-to-have feature: My EA trades based on one of several statistical checks. I can set this check before attaching the EA to a window. Normally, an EA will apply the same logic across all currency pair windows. However, I parameterized my EA to allow me chose a different statistical check for each currency pair. This allows me to customize the trading logic for each currency pair.


6) Last but not least, each currency pair has a different typical spread. I like to trade pairs with lower spreads. I've parameterized my EA to allow me to choose a different maximum spread allowed for each currency pair.


Right now, my EA is running. It has open positions on the GBPUSD, AUDUSD, USDCHF, and USDJPY windows for a total profit of $241 and climbing. And yes, I did not heed my own warning.


Good trading!!!

Reason: