How to run EA for multiple pairs? - page 4

 
cloudbreaker:

That's not correct. The OrderSend() function can be executed for any symbol you specify as the first parameter, independent of chart.

- Have the same EA attached to many charts and operating for the native symbol of each chart (using Ask and Bid built-in variables)

- Have an EA attached to a specific chart which executes for all chosen symbols (with MarketInfo() function for non-native symbols) - just using the native symbol ticks as a triggering device

OrderSend for other pairs can be done on one chart. It Just can not be done in the tester. Testing Features and Limits in MetaTrader 4 - MQL4 Articles

Why complicate things. Get it to work on the current chart, no history will be loaded, no triggering problems, no complicated function calls instead of Bid/Ask, Time[], Close[], etc. Also how do you control which pairs you want it to trade.

Once it works all you have to do is open another chart and add it there.

 
Damco: Any ideas would be greatly appreciated :-)

Here's how I would handle it. Link. I would attach my expert to EURUSD because I believe it's the most active. While this processor heavy function is processing for the first currency, in this case EURUSD, the other currencies within the Array would be forced to wait their turn.

Running One-EA-On-Every-Chart have it's advantages and dis-advantages. One example would be if you're running a scalper which just must know the latest bid/ask of the symbol because missing that one-tick could be the difference between meeting profit or losses.

One dis-advantage is a situation like this. You have a processor-heavy-function or trade-context-busy example. In these cases one usually need to consider the use of a Semaphore. Using GlobalVariable..., MathRand, File_Functions, Sleep are examples things you could use to help communicate between EAs and help sync them.

For these reasons and ease of attaching, I've opted lately to write most of my experts as multi-currency One-EA-On-One-Chart. As for resources, I believe this approach is most optimal (tho I haven't ran any calculations).

 
Ubzen:

Here's how I would handle it. Link. I would attach my expert to EURUSD because I believe it's the most active. While this processor heavy function is processing for the first currency, in this case EURUSD, the other currencies within the Array would be forced to wait their turn.

Running One-EA-On-Every-Chart have it's advantages and dis-advantages. One example would be if you're running a scalper which just must know the latest bid/ask of the symbol because missing that one-tick could be the difference between meeting profit or losses.

One dis-advantage is a situation like this. You have a processor-heavy-function or trade-context-busy example. In these cases one usually need to consider the use of a Semaphore. Using GlobalVariable..., MathRand, File_Functions, Sleep are examples things you could use to help communicate between EAs and help sync them.

For these reasons and ease of attaching, I've opted lately to write most of my experts as multi-currency One-EA-On-One-Chart. As for resources, I believe this approach is most optimal (tho I haven't ran any calculations).

Hi, I know this is an old thread but very interesting, i also like the One-EA-On-One-Chart, the only issue i am having is on pending orders , i cannot figure out how to use the MarketInfo function.

 

Great topic ... & thanks all!
Im new to multipairs trading ... I have a question:
Is it the right way to look for setup on multipairs?  ... lets say I will attach my EA on  EURUSD chart, then when there is a new tick comming on EURUSD chart, my EA will loop through the  selected Symbols Lists to check for setups & again lets say Im trying to look for setups on M15 TimeFrame ... What i need to do is to check Whether there is a new candle M15 on that pair & check If setups condition is met? 

Thank you in advance! & regards, :)

 
aphong:

 ... What i need to do is to check Whether there is a new candle M15 on that pair & check If setups condition is met?  

Yes, always check if a new bar has opened in the relevant TF for the symbol (assuming that the strategy works with closed candles)

 
Keith Watford:

Yes, always check if a new bar has opened in the relevant TF for the symbol (assuming that the strategy works with closed candles)

Thanks  Keith Watford 
in case of slow moving market on EURUSD ... Do you think we should run a software like MT4 ticker to support our EAs operation as a simple solution besides the mentioned ones above?
Just a silly idea... may be? Im still new to EAs Operation, Sory :)

 
aphong:

Thanks  Keith Watford 
in case of slow moving market on EURUSD ... Do you think we should run a software like MT4 ticker to support our EAs operation as a simple solution besides the mentioned ones above?
Just a silly idea... may be? Im still new to EAs Operation, Sory :)

I have no idea what MT4 Ticker is, but I don't see why you would need it.

 
aphong:

As you posted a link to a  commercial website, your post has been removed

 
Keith Watford:

As you posted a link to a  commercial website, your post has been removed

yep! ... below is its Description ..<Deleted>
"MT4Ticker helps you develop software for slow moving and motionless markets. MetaTrader executes your project according to each tick, and MT4Ticker simulates ticks by transmitting them to the terminal. By doing this, MetaTrader will think that the market is moving."

... so if we run it? will it help our EAs to steadlly check market condition & adoid times when market on EURUSD moving too slow that will affect the EA performance?

 
aphong:

... so if we run it? will it help our EAs to steadlly check market condition & adoid times when market on EURUSD moving too slow that will affect the EA performance?

In slow moving markets you could use OnTimer to execute your code.

Reason: