trading multiple currencies on one EA as an auto trader

 

OK, like everyone here, I have written my own EA, it does pretty well trading on one currency. The parameters are applicable to many currencies. I want to add in the otehr currencies, currently I have left the default currency to 0 (Null) so it trades in the currency in which it is attached. I have tried this to enter new currencies, I get error 4106 ERR_UNKOWN_SYMBOL here is my code:

//I first initialize the and define the variables

extern string FirstSymbol = "USDJPY";
extern string SecondSymbol = "EURUSD";

//insert logic to open position here

ticket=OrderSend(SecondSymbol,OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"EURUSD", 12345,0,Green);

if(ticket>0)
{
if(OrderSelect(ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened EURUSD: ",OrderOpenPrice());
}
else Print("Error opening BUY order : ", GetLastError());
return(0);

I get the error over and over again. It never opens a trade.

What am I doing wrong?

On a related note, is there a simple procedure to make sure that once it opens a position in one currency, it can do the same check in other currencies and open only in a different currency and not in the one which has a position open? Thanks for the help.

 
IBFX mini accounts have EURUSDm symbols and alike.
Check symbols with
Print("symbol is ",Symbol());
function. You'll get their names. I'm not sure it will help in your condition but its a must-do.

Oh and I'd recommend attaching different EAs to different charts.
As an alternative, hang up your PC with constant refreshes and checks.

Your EA works with every new tick your chart receives. If one chart freezes and others move rapidly, you'll be bankrupt. Possibly.
 
Shinigami:
IBFX mini accounts have EURUSDm symbols and alike.
Check symbols with
Print("symbol is ",Symbol());
function. You'll get their names. I'm not sure it will help in your condition but its a must-do.

Oh and I'd recommend attaching different EAs to different charts.
As an alternative, hang up your PC with constant refreshes and checks.

Your EA works with every new tick your chart receives. If one chart freezes and others move rapidly, you'll be bankrupt. Possibly.

I am with InterbankFX and my demo account is a mini account, so I will check on adding the m, although my main account is a standard account, by main, I mean live with real money,  I did not realize I could attach multiple EA's on one account, are you doing that on multiple machines or with multiple terminals loaded? I am pretty sure when I attach an EA to a chart, it de-initializes the other EA.
 
it seems that it is impossible to backtest an EA in MT4 with multiple currency trades...
Reason: