Any idea how to calculate an EMA for values stored in an unsynched array?
I log values of interest (VOI), which can occur whenever, in an array. The VOI array is on purpose not synched to the primary series. Thus, if I have 100 bars in the primary, I might only have 15 values in the VOI array. I do not want to fill the "gaps" (85 bars) in the VOI array with nonsense values (either zero or a dummy copy of the respective last value until the next "real" value occurs).
Until here, everything works exactly as expected. I can log data points as needed and correctly pull them again (e.g. VOI[14]), whenever I like to do so. .
However, I also need to be able to calculate (custom) indicators on values of the VOI array for n occurrences. Easy for a SMA using "for loops" over desired length of index and divide the total by the index length, but how to access the items of the array if I really need each individual value of n for further calcs, like for an EMA?
Direct access to the array is apparently not available. And I don't seem to be able to convert an array into a series either.
Any hint how to solve the coding challenge (or to otherwise serve my needs laid out above) is greatly appreciated.
Thx.
NT-Roland
Comment