how to set starting point for plotting

 
int OnInit() 
   { 
    datetime prev_day = TimeCurrent() - PeriodSeconds(PERIOD_D1);      
    int prev_day_index = iBarShift(_Symbol,PERIOD_D1, prev_day,false);   

    //--- indicator buffers mapping 
    SetIndexBuffer(0,high_buffer,INDICATOR_DATA);            
    SetIndexBuffer(1,low_buffer,INDICATOR_DATA);                  
    
    PlotIndexSetInteger(0,PLOT_SHIFT,prev_day_index);        
    PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,prev_day_index);     
     
   
 //--- 
    return(INIT_SUCCEEDED); 
   } 
  
 void OnDeinit(const int reason) 
   { 
  
    IndicatorRelease(rsi_handle);    
   
   } 
    
 //+------------------------------------------------------------------+ 
 //| Custom indicator iteration function            | 
 //+------------------------------------------------------------------+ 
 int OnCalculate(const int rates_total,            
                 const int prev_calculated,         
                 const datetime &time[],           
                 const double &open[],             
                 const double &high[],             
                 const double &low[],              
                 const double &close[],            
                 const long &tick_volume[],        
                 const long &volume[],             
                 const int &spread[])              
   { 
 //--- 
  
    if(IsStopped()) return(0);            //respect stop flag 
  
    for(int i=prev_calculated; i<rates_total; i++){ 
     
       datetime prev_day = TimeCurrent() - PeriodSeconds(PERIOD_D1);       
       int prev_day_index = iBarShift(_Symbol,PERIOD_D1, prev_day,false);   
        
       double prev_day_high = iHigh(_Symbol,PERIOD_D1,prev_day_index);      
       double prev_day_low = iLow(_Symbol,PERIOD_D1,prev_day_index);  
        
       high_buffer[i] = prev_day_high; 
       low_buffer[i] = prev_day_low; 
   
      
   
  } 
     
 //--- return value of prev_calculated for next call 
    return(rates_total); 
   }

I have this code that is getting the previous day's high and low but it's drawing the lines starting from left to right . But I want it to only start drawing the line at the previous day's high and low and extend line towards the right to where the current bar is.  Could anyone correct the code sample for me or show me how I can go about it please. 

Reason: