history center

 

I am trying to download historical data into a database, but my history center is not accurate.  In the image below I have highlighted records that are at the 1 minute level but in the 1 hour folder.  I had deleted all of the 1 minute records and then tried to run the script below.  But it keeps pulling 1 minute records

void OnStart()
{
   int file_handle=FileOpen("h1.csv",FILE_READ|FILE_WRITE|FILE_CSV);
   
   double   boll_top[]; 
   double   boll_bot[]; 
   datetime date_buff[]; 
   string   line;
   
   int copied=CopyTime(NULL,PERIOD_H1,0,1000,date_buff);
   ArrayResize(boll_top,copied);   
   ArrayResize(boll_bot,copied);
   FileWrite(file_handle,copied);
   for(int i=0;i<copied;i++)
   {
      boll_top[i]=iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_UPPER,i);
      boll_bot[i]=iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_LOWER,i);
      line=TimeToString(date_buff[i])+"|"+DoubleToString(boll_top[i])+"|"+DoubleToString(boll_bot[i]);
      FileWrite(file_handle,line);
   }
   FileClose(file_handle);
}


history center

 
jshumaker: I have highlighted records that are at the 1 minute level but in the 1 hour folder.  I had deleted all of the 1 minute records and then tried to run the script below.  But it keeps pulling 1 minute records
   int copied=CopyTime(NULL,PERIOD_H1,0,1000,date_buff);
      boll_top[i]=iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_UPPER,i);

Your script has nothing to do with what history you have. The first reads the H1 and the later is whatever chart is open.

You downloaded M1 data into the H1. Wrong.

Download to the M1. That does nothing for other timeframes. 447480 M1 bars is less than one years worth. If that is sufficient, run the period converter to generate the other timeframes.

 
Reason: