Moving Average - whats the actual algorithm

Discussion about JFreeChart related to stockmarket charts.
Posts: 1
Joined: Thu Nov 27, 2008 9:09 pm

Moving Average - whats the actual algorithm

Post by uzzi » Thu Nov 27, 2008 9:18 pm

Hi guys,

I'm creating some moving average graphs to go with my candlestick graphs by using the following code:

XYDataset dataset2 = MovingAverage.createMovingAverage(dataset, "Moving Average", 30 * 24 * 60 * 60 * 1000L, 0L);
mainPlot.setDataset(1, dataset2);
mainPlot.setRenderer(1, new StandardXYItemRenderer());

However, as its for a uni project, my conscience is saying that I'm taking a short cut!

Is it possible that I could get the source code for the Moving Average algorithm, in order to fully understand it and then make my own one.

I appriciate it won't be much different to algorithm of the MovingAverage.createMovingAverage source code, but nonetheless it will better my understanding and allow me to do the next steps of my project.

Thanks in advnace :-)

Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Fri Nov 28, 2008 6:39 pm