how to trade two pairs of currencies in the same EA?

 

Hi everyone,

I am try to develop an EA that can trade 2 or more pairs of currencies.

....

int ticket2=OrderSend("EURGBP",OP_SELL,0.01,Bid,0,0,0,"no comment",6666,0,Green);
int ticket3=OrderSend("GBPUSD",OP_SELL,0.01,Bid,0,0,0,"no comment",6666,0,Green);

....


But it does not work. it only can trade one of them.

Would anyone please tell me how to do?

Thanks in advanced.

 
  1. Simple: Code it to trade the current pair and put on multiple charts
  2. Harder: don't use any predefined varibles (like Bid) Those are only the current pair. You have to use Timeseries access - MQL4 Documentation
 
WHRoeder:
  1. Simple: Code it to trade the current pair and put on multiple charts
  2. Harder: don't use any predefined varibles (like Bid) Those are only the current pair. You have to use Timeseries access - MQL4 Documentation

Thanks for your very quick reply.


1, I have to run this EA in one chart at the same time;

2, I need the lastest/current prices--very tick.

I just changed ask/bid into prices getten by marketinfo( ). It was functional, but don't if the price is updated enough.

 
arbulana: 2, I need the lastest/current prices--very tick.
Start() is called only when the chart pair has a tick, not when any other pair.
Reason: