Download MetaTrader 5
To add comments, please log in or register
Do you want to deposit to your account? Do this in any convenient way!
David Soderstrom
119
David Soderstrom 2014.09.19 06:31 

Hi,

 

I have following code:

 

input string File_Name="DS_SYMBOL_INFO_SCRIPT.csv";
input datetime StartDate=D'2014.09.09 09:00:00';
input datetime EndDate=D'2014.09.12 09:00:00';

 

   for(int i=StartDate; i<=EndDate; i+=86400)
     {
      double array_high[];
      ArraySetAsSeries(array_high,true);
      
      int copied_high;
      string pair=Symbol();

      copied_high=CopyHigh(pair,PERIOD_H1,i,12,array_high);
      Print("copied_high error "+GetLastError());

      //double MaxValue=high_array[ArrayMaximum(high_array, WHOLE_ARRAY,0)];

      FileSeek(Handle,0,SEEK_END);
      FileWrite(Handle,TimeToString(i,TIME_DATE),TimeToString(i,TIME_MINUTES),copied_high);
      FileWrite(Handle,DoubleToString(array_high[5],5));



      // iATR(NULL,0,12,0);

      Print(i+" "+TimeToString(i,TIME_DATE)+" "+TimeToString(i,TIME_MINUTES));
      Print(ArrayRange(array_high,0));
      

     }

 

I have problems with the following line: copied_high=CopyHigh(pair,PERIOD_H1,i,12,array_high);

If i change the "i" to a "0" the script will work.

 

Do i define the time wrong?
Do i have to convert the variable "i" to another type?

 

Thanks for any help!

Br David 

Alain Verleyen
Moderator
28672
Alain Verleyen 2014.09.19 06:49  
It should be a datetime.
David Soderstrom
119
David Soderstrom 2014.09.19 07:19  
Thanks.
/
To add comments, please log in or register