# Problem with roc.mq4 in the Book

Do you want to write a trading robot? Find solution in MQL5 Reference!
11
2014.01.26 02:52
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?
Moderator
5394
2014.01.26 11:26
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.
11
2014.01.27 01:40
Okay I will give it a try.
522
2014.06.08 09:59
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.
983
2014.06.08 12:51
``` 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); ```
/