MQL4: run EA on the one chart for 9 different symbols - question

 

Good afternoon,


My question is: Can I program and run EA for 9 different symbols only on the one chart with started EA in the same time ?


I mean about send, modify, close orders for many symbols (for example: EURUSD, EURGBP, EURCHF, AUDUSD, USDCAD, USDJPY, EURJPY etc... ), but EA will run only on the EURUSD chart.

Each symbol on the Expert Advisor use the same indicators.


Please for the reply.


Thank you.


Regards,

Puncher

 
puncher:

My question is: Can I program and run EA for 9 different symbols only on the one chart with started EA in the same time ?


Yes, you can. (but not in tester)

 
puncher:
I mean about send, modify, close orders for many symbols (for example: EURUSD, EURGBP, EURCHF, AUDUSD, USDCAD, USDJPY, EURJPY etc... ), but EA will run only on the EURUSD chart.

Depending on how it's coded.

  1. Easy way is to just trade the pair the EA is on. As long as the OrderSelect loops filter by magic number so they don't conflict with each other and if the orderSelect loops also filter by pair, you don't need to even change the magic number. The only interaction would be context is busy type errors and using a mutex solves that.
  2. Harder is to replace Bars with iBars(symbol), Close[] with iClose, iATR(NULL) with iATR(symbol), Bid with MarketInfo(symbol, MODE_BID) etc. Every trading value must be referenced to the pair under consideration. Also you can NOT get bar zero values in the tester for the non chart pairs.
 
The only interaction would be context is busy type errors and using a mutex solves that.
One EA on one chart should not have the context busy problem.
 

Thank you for the answers and warnings. Your informations was very helpful.

Reason: