René,
Thanks once again for helping me out!! I've taken a look at the changes you've made and I understand what you've done. I had reversed the calculation direction because I'd reversed the buffer to series false. I tried doing the other way round and it didn't seem to make any difference - buffers are obviously more forgiving than arrays in EAs?
However, I'm still getting the same issue with the changes you've made. In the screen grab below you can see the strange plots that the oldest smoothed data is giving:
2019-01-16_0812.png
I've looked back at what I'm doing with limits to ensure that I'm giving the calculations enough valid back data and I think I've got it right:
2019-01-16_0810.png
While doing this I couldn't work out why the iMAOnArray couldn't just calculate a simple average from the bolli data..... and then I realised that I wasn't doing a "simple" average, I was smoothing with an exponential average. This seems to be what is causing the problem. If I change the smoothing to SMA then I don't have the issue. There must be something about the EMA calculation that either uses more back data than I've allowed for or runs iterative calculations on its own results that send the older values exponential when EMPTY_VALUE starts getting used. I've tried initialising with zero but this doesn't work either.
I don't want to waste other people's time on this more than I have done already so I think I'll look at using the SMA smoothing and see if that works for me. Alternatively I can leave it alone and just not scroll the charts back too far!!

If anyone knows why the EMA smoothing has this issue let me know.
Thanks again for your time helping me René. I really do appreciate it.
Bruster
You do not have the required permissions to view the files attached to this post.