Can one EA work with multiple currency pairs?

 

Can one EA work with multiple currency pairs, using different input variables for different pairs?


Or you need a different EA for each pair, with not just variables but the strategy optimized just for that pair?


The answer is - it depends, of course. So I'm not looking for a yes/no answer but your thoughts/experiences in general.

 
blogzr3:

Can one EA work with multiple currency pairs, using different input variables for different pairs?


Or you need a different EA for each pair, with not just variables but the strategy optimized just for that pair?


The answer is - it depends, of course. So I'm not looking for a yes/no answer but your thoughts/experiences in general.

The same EA can trade on several currency pairs but it's not very likely the same strategy to work on all of them. Also the EA cannot be backtested as MT tester doesn't allow multi currency back testing.

 

Sorry, "multiple" currency pairs was a bit ambiguous. What I meant was the same EA being used for different currency pairs, one EA-one pair at a time, using different input variables for each pair.

 
blogzr3:

Sorry, "multiple" currency pairs was a bit ambiguous. What I meant was the same EA being used for different currency pairs, one EA-one pair at a time, using different input variables for each pair.

I would use different strategies for different pairs.

 

I have set external variables to turn on and off pairs listed below. I have nearly worked through the Magic number issue. How do I incorporate these pairs to be traded off the same chart? This is a grid based strat so I am not worried about the difference between pairs. Please help.

if (Symbol() == "EURCHF") {MagicNumber= PipRipper+01+Period();}

if (Symbol() == "USDCHF") {MagicNumber= PipRipper+02+Period();}

if (Symbol() == "GBPCHF") {MagicNumber= PipRipper+03+Period();}
if (Symbol() == "CADCHF") {MagicNumber= PipRipper+04+Period();}
if (Symbol() == "GBPUSD") {MagicNumber= PipRipper+05+Period();}
if (Symbol() == "EURUSD") {MagicNumber= PipRipper+06+Period();}
if (Symbol() == "NZDUSD") {MagicNumber= PipRipper+07+Period();}
if (Symbol() == "USDCAD") {MagicNumber= PipRipper+08+Period();}
if (Symbol() == "AUDCAD") {MagicNumber= PipRipper+09+Period();}
if (Symbol() == "EURCAD") {MagicNumber= PipRipper+10+Period();}
if (Symbol() == "USDJPY") {MagicNumber= PipRipper+11+Period();}
if (Symbol() == "AUDJPY") {MagicNumber= PipRipper+12+Period();}
if (Symbol() == "CHFJPY") {MagicNumber= PipRipper+13+Period();}
if (Symbol() == "CADJPY") {MagicNumber= PipRipper+14+Period();}
if (Symbol() == "NZDJPY") {MagicNumber= PipRipper+15+Period();}
if (Symbol() == "AUDNZD") {MagicNumber= PipRipper+16+Period();}
if (Symbol() == "EURJPY") {MagicNumber= PipRipper+17+Period();}
if (Symbol() == "EURGBP") {MagicNumber= PipRipper+18+Period();}
if (Symbol() == "EURAUD") {MagicNumber= PipRipper+19+Period();}
 
Totally not necessary. One magic number or maybe one+TF. The orderSelect/orderSymbol handles rest.
    for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if (
        OrderSelect(pos, SELECT_BY_POS)
    &&  OrderMagicNumber()  >= Magic.Number.Base        // Only my orders w/
    &&  OrderMagicNumber()  <= magic.number.max         // my magic number
    &&  OrderSymbol()       == Symbol() ){              // period and symbol
The EA should only process the current chart Symbol. The EA is placed on multiple charts/symbols to trade multiple pair. If you don't want the EA to trade a symbol, don't put it on that chart.
 

Hi,
same question

does anyone know? 

my EA works well only on EUR/USD, is it risky to use it ?   

 
sergeyrar:

Hi,
same question

does anyone know? 

my EA works well only on EUR/USD, is it risky to use it ?   

Don't double post !   https://www.mql5.com/en/forum/143352
Reason: