How to draw a yearly chart(data points)

Discussion about JFreeChart related to stockmarket charts.
Locked
afa654321
Posts: 2
Joined: Wed Jun 28, 2006 5:27 pm

How to draw a yearly chart(data points)

Post by afa654321 » Mon Jul 03, 2006 3:02 am

Hello all,

I am trying to draw various charts from a set of full historical data(2 years worth). My question is what data pionts should I be using to darw, say, a yearly chart? Should I be using HLOC and average for each day(5 tick data/day) and collect 5x256 data points to draw a yearely chart? How about monthly, weekly chart?

Thx.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Jul 03, 2006 5:36 pm

You can do any of those, it is up to you.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

afa654321
Posts: 2
Joined: Wed Jun 28, 2006 5:27 pm

Post by afa654321 » Wed Jul 05, 2006 6:47 pm

DG, thx for the reply.

My question is that, e.g., for MSFT, I have 300 trades/day for the entire year(roughly 8000 trades/tick data). How can I(how many ticks/day should I choose) to draw a yearly chart so that it truly represents the nature of the actual trades that have taken place in that year. I have used the Hour class with 8760(1 year) entries and it slows down somewhat(also mentioned by DG in the demo code).

Many thanks.

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

Post by skunk » Fri Jul 07, 2006 10:09 pm

A yearly chart by definition contains one bar per year. You will need to scan through all your shorter interval data (daily should be fine) and track the highest high and lowest low of each bar -- use these for your high and low values for the year. The open will be the open of the first day, the close will be the close of the last day. The volume will be equal to the sum of the volume of each individual day.

Locked