Has anyone successfully created intraday OHLC charts?
Start looking here
http://www.jfree.org/phpBB2/viewforum.php?f=10
http://www.jfree.org/phpBB2/viewforum.php?f=10
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
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
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.
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.
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
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());
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.
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.