Those garbage values are probably the farthest back in time. Why do you need them at all*
*Sorry I only realised now this is in the wrong section, but thanks for replying.
Actually I don't need them all. I am coding a function to calculate the RSI on any buffer. But smoothing price before rsi calculation brought up this problem.
I suppose I could just ignore the first 200 values or so but that is a cheap trick. There must be a logical way to filter out those first nonsense values.
*Sorry I only realised now this is in the wrong section, but thanks for replying.
Actually I don't need them all. I am coding a function to calculate the RSI on any buffer. But smoothing price before rsi calculation brought up this problem.
I suppose I could just ignore the first 200 values or so but that is a cheap trick. There must be a logical way to filter out those first nonsense values.
This is the EMPTY_VALUE, it is often used to prime plot buffers because it will not be plotted. It is the highest double value that can be expressed, see documentation.
Thanks Tobias. I knew I was missing something obvious. Appreciate your help.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Calculating a moving average on price data usually means the first few values of the MA buffer (usually the period), is empty. That makes sense. But on closer inspection I found that the first 8 values of the iDEMA buffer with period of 5 contains a random float value, far removed from the price data:
I initialized the buffer to 0.0 before I called CopyBuffer.
My question is is there a way to filter out that data, and other first garbage values from copied buffers? I can't search for empty or 0 values obviously. Using the period of the MA also won't work, as it seems to me that there is no relationship between the period and the amount of values that are unusable.
In other words is there a global solution for all CopyBuffer results on all moving averages?
Anyone with an idea? Thank you very much.