Custom Indicator and it decreasing loop

 
Hi all,

Most of the indicators I have checked out has its main loop made up with a decreasing counter. As instance, something like this:

int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- main loop
   for(int i=0; i<limit; i++)
     {
      MAIN CODE of the Custom Indicator
      }

I've tried to change the main loop for something like this:
 
//---- main loop
   for(int i=limit; i<=0; i--)
     {
      MAIN CODE of the Custom Indicator
      }
But as result, my Buffers stopped working properly. Actually, they didn't worked anymore at all.

So, if you have a clue of how I can use a loop with an increasing counter and KEEP MY BUFFERS WORKING I would really appreciate.

Thank you so much,
your help is valuable,
brspMA
 
for(int i=limit; i>=0; i--)
Try this.
 
janklimo:
for(int i=limit; i>=0; i--)
Try this.
:) it worked very well...

I guess it is time for a cup of coffee...

Thank you so much!