Problem with roc.mq4 in the Book

 
I copied roc.mq4 from https://book.mql4.com/samples/iroc exactly the way it is then attached it to a chart and I don't see any lines there at all. Why?
 
Pierre1701: I copied roc.mq4 from https://book.mql4.com/samples/iroc exactly the way it is then attached it to a chart and I don't see any lines there at all. Why?
The examples from the book usually have small errors it needs you to fix in-order to get it working. Think of it as home-work.
 
Okay I will give it a try.
 
I also have tried to fix/workaround the drawing issue, but without real success. Still hope that very good indi be updated/fixed by a skilled coder.
 
 if (Aver_Bars>0)  Aver_Bars=0;  

 if (Aver_Bars<0)  Aver_Bars=0;  

 the way it is  : 

 if (Aver_Bars>0)              // If wrong set smoothing
         Aver_Bars=0;               // .. no less than zero
      Sum=0;                        // Technical means
      for(n=i; n>=i+Aver_Bars; n++) // Summing last values
         Sum=Sum + Line_4[n];       // Accum. sum of last values
      Line_5[i]= Sum/(Aver_Bars+1); /

    this way it work  :

     if( Smooth<0 )  Smooth = 1;               // .. no less than zero
      Sum=0;                      
      for(n=i+Smooth; n>=i; n--) Sum=Sum + Line_4[n];       
      Line_5[i]= Sum/(Smooth+1); 
Reason: