Has anyone successfully created intraday OHLC charts?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
clam61
Posts: 66
Joined: Tue Jul 03, 2007 9:59 pm

Has anyone successfully created intraday OHLC charts?

Post by clam61 » Thu Jul 26, 2007 5:31 pm

???

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

Post by skunk » Thu Jul 26, 2007 7:47 pm


clam61
Posts: 66
Joined: Tue Jul 03, 2007 9:59 pm

Post by clam61 » Thu Jul 26, 2007 7:56 pm

i have, but i only saw old posts with problems concerning daylight savings, etc.

i tried to create my own intraday chart using one minute segments, but my bars kept overlapping

http://www.jfree.org/phpBB2/viewtopic.php?t=21925

jwenting
Posts: 157
Joined: Sat Jul 15, 2006 7:46 am

Post by jwenting » Fri Jul 27, 2007 6:23 am

that most likely means you try to cram too much data into too small a chart.

Simply put, if your chart is 2000 pixels wide and spans an entire 24 hour interval, you still have only 100 pixels per hour, or under 2 pixels per minute.
That's never going to fit all your data, so you either have to have a humongously wide chart (5000 pixels at least I guess) or reduce the data density.

I did some experimenting, and at 1000 pixels wide (ridiculous for most purposes) a 5 minute interval shows each tick individually when showing data for an entire market open interval (which for the market I used is 0900 to 1700) with some space to the sides as margins.

clam61
Posts: 66
Joined: Tue Jul 03, 2007 9:59 pm

Post by clam61 » Fri Jul 27, 2007 7:13 am

i have at most 40 bars on the chart at one time. i dont think its too much.

i also tried setting it to 10 bars...same problem happens.

i am loading data from 9:30am to 4:00pm PST. i am loading 78 minute bars, which do not make even segments which is why i am using a minute segment size.

here is the code

Code: Select all

        
SegmentedTimeline timeline = new SegmentedTimeline(SegmentedTimeline.MINUTE_SEGMENT_SIZE, 390, 1050);

timeline.setStartTime(SegmentedTimeline.FIRST_MONDAY_AFTER_1900 + (570 * timeline.getSegmentSize()));

timeline.setBaseTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());        

clam61
Posts: 66
Joined: Tue Jul 03, 2007 9:59 pm

Post by clam61 » Fri Jul 27, 2007 7:40 am

ok...revise the problem. my 78 minute bars work except for the weekends.

they are still not excluded

jwenting
Posts: 157
Joined: Sat Jul 15, 2006 7:46 am

Post by jwenting » Fri Jul 27, 2007 8:52 am

how large is that chart?
78 datapoints is hardly minute intervals for an entire trading day, so there are large gaps there (unless you exclude every minute from your TimeLine where there's no data, which IMO would be inappropriate).
But still, if each element takes up say 5 pixels, 78 elements would need a plotarea at least about 400 pixels wide to show without them overlapping.
The total chart (including axes and other decorations) would then need to be 450 to 500 pixels wide at least.
If your datapoints aren't evenly distributed that number goes up of course, as there will be larger gaps in some places and smaller in others.

clam61
Posts: 66
Joined: Tue Jul 03, 2007 9:59 pm

Post by clam61 » Fri Jul 27, 2007 3:24 pm

a 78 minute chart is 1/5 of a 6.5 hour trading day (9:30 to 4:00)

everything works from monday to friday--no gaps, but weekends do not seem to be excluded at all.

clam61
Posts: 66
Joined: Tue Jul 03, 2007 9:59 pm

Post by clam61 » Fri Jul 27, 2007 3:57 pm

i loaded a 15 minute chart, based on newFifteenMinuteTimeline and I still have gaps for weekends!

seems like setting a basetimeline does nothing.

dnesbitt
Posts: 1
Joined: Thu Dec 13, 2007 5:10 pm

Post by dnesbitt » Thu Dec 13, 2007 5:10 pm

I'm also getting the same problem. setBaseTimeline() is useless.

Locked