Single EA for Different Currency Pairs Condtion Testing based on Indicator & Placing Orders

 

Hi

Is it possible to build an EA which can test the indicator conditions and place/close the orders accordingly on different/multiple currencies simultaneously.

I tried in script module:-

1) Getting list of all instruments provided by broker.

2)Tested them one by one based on indicator conditions and placed / closed orders accordingly

These are working fine in script module, but I am not able to get the codes working inside EA module. I do not want to open multiple chart and attaching

the EA, created for a single instrument, to all charts. I just want to scan the instruments available with broker, monitor them and place/close the orders accordingly.


Can anyone provide any suggestions for this?

Thanks

Persi

 
persi:

Hi

Is it possible to build an EA which can test the indicator conditions and place/close the orders accordingly on different/multiple currencies simultaneously.

I tried in script module:-

1) Getting list of all instruments provided by broker.

2)Tested them one by one based on indicator conditions and placed / closed orders accordingly

These are working fine in script module, but I am not able to get the codes working inside EA module. I do not want to open multiple chart and attaching

the EA, created for a single instrument, to all charts. I just want to scan the instruments available with broker, monitor them and place/close the orders accordingly.


Can anyone provide any suggestions for this?

Thanks

Persi

Yes, you can do this, but it's not that simple.

This example - in MQL4 - placed on a single "host" chart should display the ATR values and ASK price for each symbol.....If you didn't want to use SymbolName, you could just use your own array of Symbol names.....

But there's a few other things to consider. For example, if you're using a new bar function, it has to operate on the relevant symbol, not the symbol of the host chart....

string txt,symb;
for(int i=0;i<SymbolsTotal(true);i++){
 symb=SymbolName(i,true);
 txt=StringConcatenate(txt,symb," ",iATR(symb,_Period,14,1)," ");
 txt=StringConcatenate(txt,MarketInfo(symb,MODE_ASK),"\n");
 }
 Comment(txt);
Reason: