Bill Cunningham said:
I am trying to create a moving average of data. Whether it be for 5-10-30
days of securitites prices.
I'm not sure, but I *think* you've finally answered the question I
asked at least twice, if only indirectly.
Each input line contains a number. Each output line contains the
number from the corresponding input line, followed by the sum of all
the input numbers seen so far, followed by the mean of all the input
numbers so far.
Is that correct? If so, why didn't you just say so in the first
place, or at least after I asked?
If (and only if!) you confirm that my description is an accurate
statement of the problem you're trying to solve, I'll give you some
hints about how to solve it. If I haven't described the problem
correctly, please clarify.
Your stubborn insistence on trying to solve a problem when you haven't
clearly stated what the problem is has caused a lot of people to waste
a lot of time.
Presumably you know what you want to accomplish. Go back to your
initial article in this thread, and ask yourself whether someone could
figure out what you're trying to do based only on your description.
Then think about how you could have made your description clear
enough. And next time, *please* try to formulate your question
clearly *before* you post it here.
Incidentally, I could probably write a working program to solve your
problem in about 5 minutes. Guiding you through the process takes a
lot longer. But handing you the solution wouldn't do you much good.