Re: simple moving average
- Posted by Ricardo Forno <ricardoforno at tutopia.com> Feb 24, 2007
- 538 views
mark wrote: > > > i am wondering if anybody is willing to program a simple moving average graph > i am willing to pay for the service > basicly i have a real time data from the broker > data supplied gives many values > i am only in taking the closing price at a given time frame e.g. 1 min, 5 min, > 15 min. etc > and plot a simple moving average > the moving average will be of say the last 4 closing prices, or 20 etc > the program should prompt for: > > time frame: in min or day > no of closing prices to be used for calculating the moving average > ut will be nice if the graph cna have color for the different closing price > thanks I'm not offering to do the job, but: did you think about using exponential smoothing instead of moving average? The formula is very simple, and it does not need to save more than a single data item. If the last data is called x, and the new one z, then you get the forecast for the next one as: next = x * (1 - coef) + z * coef where coef is a coefficient between 0 and 1. A large coefficient places more weight on the new data. This formula usually gives smoother results than moving average. Regards.