problem with Moving average
-
- Posts: 15
- Joined: Fri Jan 11, 2008 10:58 am
problem with Moving average
Hello???
I'm working with candleStick chart and want to create moving average of 13 days.the chart is working fine but my problem with moving average. how can i create an moving average of a specific period( ie. 13 days)?????
plz help!!!!!
I created my line chart as shown below:
ts = new TimeSeries("Stock", Minute.class);
And I created the 10-day moving average as below:
TimeSeries ma10 = MovingAverage.createMovingAverage(ts, "10 day", 14400, 0);
14400 is the no. of minutes in 10 days
It seems the graph is correct.
Please notify me if my method is wrong.
ts = new TimeSeries("Stock", Minute.class);
And I created the 10-day moving average as below:
TimeSeries ma10 = MovingAverage.createMovingAverage(ts, "10 day", 14400, 0);
14400 is the no. of minutes in 10 days
It seems the graph is correct.
Please notify me if my method is wrong.
-
- Posts: 15
- Joined: Fri Jan 11, 2008 10:58 am
Hello..
Hello gerlun:
Thanks for ur reply, My problem is.. I'm using createMovingAverage() method that returns XYDataset. I did something like this...
dataset= MovingAverage.createMovingAverage(dataset, "Moving Avg", 60*24*14,0);
plot.setDataset(1,dataset2);
but as per ur example, this method returns TimeSeries...
is there any way to do with the TimeSeries!!
please help!!
Thanks for ur reply, My problem is.. I'm using createMovingAverage() method that returns XYDataset. I did something like this...
dataset= MovingAverage.createMovingAverage(dataset, "Moving Avg", 60*24*14,0);
plot.setDataset(1,dataset2);
but as per ur example, this method returns TimeSeries...
is there any way to do with the TimeSeries!!
please help!!