How do I make the EA in MQL4 for multi currency - page 2

 
try this
 

Here's a simple template to give you some idea.

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void start(){
    string  Fx__Symbol;
    string  Symbol_Ray[]={"EURUSD","USDJPY","GBPUSD","USDCHF","AUDUSD","USDCAD"};
    for(int i=0; i<ArraySize(Symbol_Ray); i++){
        Fx__Symbol=Symbol_Ray[i];
        if(IsTesting()){Fx__Symbol=Symbol(); i=9999;}
        /* 
            The Rest Of Your Codes Goes Here..(Within For Loop)
            Will Cycle Through Each Symbol Within The Symbol_Ray Array
            From Left ---> To Right When Attached To A Live Chart.
            When Testing, It'll Only Use The Test Symbol 
            (Mt4 Does-Not Support Multi-Currency Testing)
            Then It Sets i To a High Number Which Avoids Processing
            One Tick Multiple Times While Testing.
        */
}   }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
ubzen:

Here's a simple template to give you some idea.

thanks! this helped a lot.
 

Have a look in here 

https://forum.mql4.com/68325

 https://www.mql5.com/en/forum/61041

 
acday: How do I make the EA in MQL4 for multi currency.
Do not trade multiple currencies
  • You can't use any predefined variables, can't use the tester, must poll (not OnTick,) and usually other problems.
  • Code it to trade the chart pair only. Look at the others if you must.
  • Then put it on other charts to trade the other pairs. Done.
 

Nice!! Thanks!




Ubzen #:

Here's a simple template to give you some idea.

Nice!! Thank you!!

Reason: