Download MetaTrader 5

Get Bars from different currency pairs

To add comments, please log in or register
dolemi
145
dolemi  

Hi,

    How can I get Bars from different currency pairs?

   eg. Bars for data iClose("OtherPairs", Period(),0)


   Thanks in advance!

Gordon Gekko
622
Gordon Gekko  
dolemi:

Hi,

    How can I get Bars from different currency pairs?

   eg. Bars for data iClose("OtherPairs", Period(),0)


   Thanks in advance!

double Val=iClose("USDCHF",PERIOD_H1,0);

or

double Val=iClose("GBPUSD",PERIOD_M15,3);

etc...

dolemi
145
dolemi  
ggekko:

double Val=iClose("USDCHF",PERIOD_H1,0);

or

double Val=iClose("GBPUSD",PERIOD_M15,3);

etc...

Now, val= iClose("USDCHF",PERIOD_H1, Max_Index);

     What is the Max_Index I can have?

   for (int i=0; i<=Max_Index; i++)

  {

         Buffer[i] =iClose("USDCHF",PERIOD_H1,i);

  }


Gordon Gekko
622
Gordon Gekko  
dolemi:

Now, val= iClose("USDCHF",PERIOD_H1, Max_Index);

     What is the Max_Index I can have?

   for (int i=0; i<=Max_Index; i++)

  {

         Buffer[i] =iClose("USDCHF",PERIOD_H1,i);

  }


For example:

Max_Index=iBars("USDCHF",PERIOD_H1)-1;

dolemi
145
dolemi  
ggekko:

For example:

Max_Index=iBars("USDCHF",PERIOD_H1)-1;

Thanks!

whroeder1
16108
dolemi
145
dolemi  
To add comments, please log in or register