|
And my response...
I think TR's Rolling OsMA is just a summation of the last x OsMA
values divided by x. It's only an educated guess that it's even an
approximation of what the actual rolling values might be.
I was only planning to use the Close data to calculate the EMAs. So
I wasn't collecting OHLC data like that. Makes the idea a little
easier. My problem is that indicators have to be coded a little
differently than experts. They usually use something like Bars-
IndicatorCounted() to loop through all the bars on the chart that
haven't been calculated. I wrote something that does that, but it
only creates one array of Close values going back from the current
day and then displays a rolling OsMA from that array over all the
bars. The problem is that it's only accurate for the current day
because the array of Close values from yesterday should be
different. Today's array is { Close[0], Close[5], Close[10], ... }.
Yesterday's array should be { Close[1], Close[6], Close[11], ... }.
The day before that should be { Close[2], Close[7], ... }, etc...
So how, in an indicator, do you code it to, on every bar, recalculate
that array? It's some crazy loop that I keep getting stuck on. I
always hated recursive programming.
-lcg
|