EA with multi pairs trading

 

Dear all

 

I coded a EA to trade with multi pairs:

   for( int z=1; z<=3; z++ )
   {
      
      switch(z)
      {
         case 1: symbol = "GBPUSD"; 
            count_2_1440_up = count_2_1440_GU_up; count_2_1440_dn = count_2_1440_GU_dn; 
            ctime_2_1440_up = ctime_2_1440_GU_up; ctime_2_1440_dn = ctime_2_1440_GU_dn;
            break;
         case 2: symbol = "EURUSD"; 
            count_2_1440_up = count_2_1440_EU_up; count_2_1440_dn = count_2_1440_EU_dn; 
            ctime_2_1440_up = ctime_2_1440_EU_up; ctime_2_1440_dn = ctime_2_1440_EU_dn;
            break;
         case 3: symbol = "AUDUSD"; 
            count_2_1440_up = count_2_1440_AU_up; count_2_1440_dn = count_2_1440_AU_dn; 
            ctime_2_1440_up = ctime_2_1440_AU_up; ctime_2_1440_dn = ctime_2_1440_AU_dn;
            break;
      }
      
      exit conditions, entry conditions, etc.



   }

 

However, when I insert it into a GBPUSD chart, it only works normally for GBPUSD with no response from EURUSD and AUDUSD.  When I put it into a EURUSD chart, it works only with EURUSD too.

 

What I want to know is, whether it is normal or there is an error in my code.

 

Would you like to share your experience?

 

Thanks a lot!

 

wing 

 
wing:

Dear all

 I coded a EA to trade with multi pairs:

 However, when I insert it into a GBPUSD chart, it only works normally for GBPUSD with no response from EURUSD and AUDUSD.  When I put it into a EURUSD chart, it works only with EURUSD too.

 What I want to know is, whether it is normal or there is an error in my code.

No idea if there is an error in your code,  you have only shown part of it that is irrelevant . . .  for example where does the value of this vaariable come from ?  count_2_1440_GU_up
 
Example. Try using Print/Comment/Alerts to debug your codes.
 
ubzen:
Example.


Your example is great!  It proves that multi pairs can be considered in one single EA and there should be mistake in the rest of my code.

 

That's what I want to know. 

 

Thank you!