Csv file data to indicator Buffer plotting wrongly

 

Hi I have following code

int init()
{
 
  //---- indicators
   SetIndexBuffer(0,M1);
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1,clrBlue);
   
return(0);
}
//--------------------------------------------------------inside the start function--------------//
int counter = 0;
while(FileIsEnding(Handle)==false)  // While the file pointer..
     {                                 // ..is not at the end of the file

      //--------------------------------------------------------- 5 --
      Str_DtTm =FileReadString(Handle);// Date and time of the event (date)
      D1     =FileReadString(Handle); 
      D2     =FileReadString(Handle); 
      D3     =FileReadString(Handle); 
      
      counter++;
      
      if(FileIsEnding(Handle)==true)   // File pointer is at the end
         break;                        // Exit reading and drawing
      //--------------------------------------------------------- 6 --
      Dat_DtTm =StrToTime(Str_DtTm);   // Transformation of data type
           
      DD1 = floor(StrToDouble(D1)); 
      DD2 = floor(StrToDouble(D2)); 
      DD3 = floor(StrToDouble(D3)); 

      L1 = *Calculation*;
      M1[counter] = L1;

}
 

Above code is plotting the data with indicator buffer but its starting from wrong place. I know i didn't added SetIndexDrawBegin. But How can i initiate that before reading the csv file? 

With Csv file Dat_DtTm is the variable where the start of the index draw begins.  Its stores the start date of csv file. I need indicator buffer get plotted from that time. 

I tried using ibarshit with Dat_DtTm & SetindexdrawBegin inside start function & but if got failed. Any idea?

Thank you in advance. 

 
Ignore SetIndexDrawBegin, just start drawing at the correct bar, not before.
 
WHRoeder:
Ignore SetIndexDrawBegin, just start drawing at the correct bar, not before.

How can I do that?

int tt = iBarShift(Symbol(),0,Dat_DtTm);
M1[counter] = L1;

Where I can put this tt for drawing at the correct bar? Need little syntax help here.

 
   int tt = iBarShift(Symbol(),0,Dat_DtTm);
// M1[counter] = L1;
   M1[tt] = L1;
Was that so hard? When in doubt, think.
 
WHRoeder:
Was that so hard? When in doubt, think.

Thank you...:) 
Reason: