A stupid oscillator

 

A stupid oscillator that i want to show the result of the range variabile...

If the range a 5days today is 140, mark a line there, if tomorrow will be 150 mark a line there and so on....

i had fixed the top and the bottom at 120 and 250

how i can do it...because not appear nothing in the indicator!!!



#property indicator_separate_window
#property indicator_minimum 120
#property indicator_maximum 250
#property indicator_buffers 1
#property indicator_color1 C'None'
//---- input parameters
extern int NRangeday=3;
//---- buffers
double rangebuffer[];


for(k=(i+NRangeday-1);k>=i;k--)
      {
       R5    =    R5  +  (iHigh(NULL,PERIOD_D1,k)-iLow(NULL,PERIOD_D1,k))/Point;
       }
   rangebuffer[i] = R5/NRangeday;
Reason: