Gap on indicator or not refreshing indicator, Happens to you? What to do?

 

Hi guys, 

I has been working on creating simple indicators based on technical indicator as IMA and IStochastic, this two on particular gave me some troubles, not getting refreshed and have to open their base code and compile it. 

They are not running complex operations, and just using a simple loop to run their:

  for (int i=0; i<Bars; i++)
   {
    double Base=iMA(NULL,0,Min_Period,0,2,0,i);
    double MA_A=iMA(NULL,0,Period_A,0,2,0,i);

    Label1Buffer[i]=Base/MA_A;
   }

So simple right? But is not updating on the separated window. 

I have same format loop on other indicators and have no problem updating,

Have you have same problem and know how to fix it? 


Thank you in advance

 
Please edit your post and use the code button (Alt+S) when pasting code.

EDIT your original post, please do not just post the code correctly in a new post.

What is the variable  MA_B and where does it get a value?

 
 Thank you Keith, this is my code, I has mistyped MA_A.