Array Copy Settings Display Pairs

To add comments, please log in or register
Fernando Santos
139
Fernando Santos  

Hello Everybody.

I created this function to load the pairs symbol in the graph, but it only carries the first and last pair, I need each pair have the string separated the way it is.


Look.

extern bool UsePairs=true; 
// String Symbols 

string DEURUSD[] = {"EURUSD"};
string DAUDCAD[] = {"AUDCAD"};
string DUSDJPY[] = {"USDJPY"};
string TradePairs[];


// On Init Load Pairs 
int OnInit()
  {   
 if (UsePairs == true)
      ArrayCopy(TradePairs,DEURUSD,
      ArrayCopy(TradePairs,DUSDJPY,
      ArrayCopy (TradePairs,DAUDCAD)));
}
}


Anthony Garot
1830
Anthony Garot  

This will load all three pairs

                ArrayCopy(TradePairs,DEURUSD,0);
                ArrayCopy(TradePairs,DUSDJPY,1);
                ArrayCopy (TradePairs,DAUDCAD,2);
But there is perhaps an easier way to do this:
string TradePairs[] = {"EURUSD", "AUDCAD", "USDJPY"};
Fernando Santos
139
Fernando Santos  
Anthony Garot:

This will load all three pairs

But there is perhaps an easier way to do this:

Knowledge is a gift, it solved my problem.
Thank you very much.

To add comments, please log in or register