coundted bars

 

Hi i would like a maximun of 1000 bars in my indicators how do i do this ?

tia

 if(counted_bars<0) return(-1);

   if(counted_bars>0) counted_bars--;

           limit=MathMin(Bars-counted_bars,Bars-1);

           if (returnBars) { t3[0] = MathMin(limit+1,Bars-1); return(0); }

 
Wansiman:

Hi i would like a maximun of 1000 bars in my indicators how do i do this ?

tia



limit=MathMin(Bars-counted_bars,1000);
 
3rjfx:

Thanks 
Reason: