Login
Login

Re: computing moving average

Home 21090308 Forums Re: computing moving average

#1996
Ryu
Member

First of all, you don’t instruct the IDE to do any computation. IDE stands for “Integrated Development Environment”. It is nothing more than a smart text editor for you to type in code (and maybe compile, etc).

To compute moving average, you can check out how this class does it:

Basically, SuanShu provides a class named

.

For example,

In addition, in the macrossover example, we do not store any data. For the sake of computing moving average, you don’t need to store any data, you can just pass in the data to a [tt:11r03o4e]MovingAverage[/tt:11r03o4e] instance.

If you have to store data, in Java, there are many ways to do it, e.g., array, ArrayList, etc.

Hope this helps.