Filtering series data?

Posted By: Gheo

Filtering series data? - 01/07/23 22:16

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 picture smaBrokenPlotLine.png
Posted By: Spirit

Re: Filtering series data? - 01/08/23 08:00

I think the simplest way is TimeFrame. If you want only every 10th price, set TimeFrame = 10 before creating the series.
Posted By: Gheo

Re: Filtering series data? - 01/11/23 19:57

Thank you.
© 2024 lite-C Forums