How to correct time from tick data ?

 

Hi there,


I wrote a script that downloads the current and the courses of the past months.
The problem is that the times of the courses are one hour ahead.
You would have to pull off for 1 hour
Unfortunately I can't get any further

Time intervall is M5 and M10


Tomm


MqlRates rates[];
   MqlDateTime tm;

   ArraySetAsSeries(rates,true);


   string   start_time=IntegerToString(Year)+"."+IntegerToString(Month,2,'0')+"."+IntegerToString(Day,2,'0');  


 copied=CopyRates(Symbol(),_Period,StringToTime(start_time),TimeCurrent(),rates);
  if(copied>0)
     {

      FileHandle=FileOpen(FileName,FILE_WRITE|FILE_ANSI);
      if(FileHandle!=INVALID_HANDLE)
        {    
         FileWrite(FileHandle,"Open;High;Low;Close;Volume;Datum;Uhrzeit");        

    for(int i=copied-1;i>=0;i--)
           {  
            TimeToStruct(rates[i].time,tm);
            if((tm.hour>6)&&(tm.hour<23)) 
             {  FileWrite(FileHandle,
                           DoubleToString(rates[i].open,2)+";"+
                           DoubleToString(rates[i].high,2)+";"+
                           DoubleToString(rates[i].low,2)+";"+
                           DoubleToString(rates[i].close,2)+";"+
                           DoubleToString(rates[i].tick_volume,0)+";"+
                           StructToTime(tm));              
           }
            }
Forum für Händler - MQL5.community
Forum für Händler - MQL5.community
  • www.mql5.com
MQL5: Forum über Handel, automatische Handelssysteme und Strategietests