I want to select specific data points from OpenPrice series and use only those data points to make a Moving average plot line.

The distance between those data points is variable and I am not sure if I implement it as array it will stick the MA plot line in the right place.

I tried to store the filtered data points on a series but I either get:

A 000000 B 00000000000 C 000
Or
AAAAABBBBCCCCCCC

which doesn't help with drawing at all.

Last bar function confuse repetitive values order and the repetitiveness is variable so no point to tell it a fixed iteration.

If there is a way to ignore 0 values for ploting kr calculations of functions without ignoring the original index of the data points that would be great.

Kinda like if A[i]!=0 then SMA(A[i]) else do nothing

When i do conditions like that the SMA line is broken and if i store it's past values it creates straight lines.

All i need is to filter out zeros from series when i want to use functions or indicators.

Any advice?

Attached Files smaBrokenPlotLine.png
Last edited by Gheo; 01/07/23 22:23.