Indicator Buffer issue

 

I have an indicator that adds values to the previous value of the buffer.

My formula is: buffer[i] = buffer[i+1] + some_values

Now the problem is after sometime when attaching the indicator to the chart, all the values indicator repaint. See images below:

After attaching to chart:


After sometime or when changing timeframes then going back again:

The plots should start from zero but here it looks like it started from value of the current bar then all of them converge going to zero.

I already tried initializing the buffers in OnInit and prev_calculated=0 but got no luck. Is this a bug in buffer?

 

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem

We can't see your broken code.