"while" loop - indicator not tracing on last bar

 

Hi,

My problem is simple. I am using the following loop for computing my indicator.

   while(i>=0)
   {
   i--;
   CODE HERE
   }

Now, If i go to the MetaEditor and compile again the indicator, it shifts the 500 period forward and compute the next live bar I see, but it does it once of course.

So my question is:

Considering the current loop I am using can I insert a code telling the indicator to continue computing using something like

while(i>=-10000)

  {  
  i--; 
  CODE HERE 
  }

instead (doesn't work)

Or can is there a simple way to force the indicator to autocompile on every new bar or tick, or reinitialize so the 500 period shift forwards everytime ?

Many thax

inquisiteur

 
inquisiteur wrote >>

Hi,

My problem is simple. I am using the following loop for computing my indicator.

Now, If i go to the MetaEditor and compile again the indicator, it shifts the 500 period forward and compute the next live bar I see, but it does it once of course.

So my question is:

Considering the current loop I am using can I insert a code telling the indicator to continue computing using something like

instead (doesn't work)

Or can is there a simple way to force the indicator to autocompile on every new bar or tick, or reinitialize so the 500 period shift forwards everytime ?

Many thax

inquisiteur

BUMP! ...