Candlestick candle width

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Andrew Perepelytsya

Candlestick candle width

Post by Andrew Perepelytsya » Tue May 14, 2002 10:04 pm

Hi, people.

Got an idea of some sort of dynamic candlewidth adjustment?

The problem:
Let's say I display last weeks stock data. the size of the image is fixed to some extend - it's a dynamically generated chart (servlet). So, the candles are big and thick (or fat? ;) And they are standing TOO close to each other, no space in between.

Ok, we reduce the candle width (see CandlestickRenderer class), but... It's not the solution. If I have, say 2 months' period (40-50 items) I'd rather have small candles. But if I reduce the frame to one week, they are still the same width, and we have huge spaces.

What I'd like to see in future versions is a setter method for space between candles, and the their width would be calculated dynamically.

I'll be looking into the problem myself, but if there are some ideas around, it would be nice to have them discussed.

My plan for tomorrow (I guess not only tomorrow ;) is to try to derive the information about the dataset (it's size), and then, according to the size of the plot, have some sort of candle width adjustment.

If that's the way to explore, say your yes, people ;)

Best regards

P.S.: sorry for a long post, but the problem is quite low-level here and requires more details.

Mudit Wahal

Re: Candlestick candle width

Post by Mudit Wahal » Wed May 15, 2002 12:56 am

Yes, I'd be interested in something similar. Also, another charting technique in stocks is Equivolume charts. In equivolume chart, the volume of last N days is averages and then the width of each bar/candle is dependent on that day's volume vs the average volume. The idea is to see the days when there is huge price gains on large volume. These are strong days.

Andrew, BTW, you can extend the CandlestickRenderer method and override drawItem method. Also extend the HighLowDataset and introduce a new element for width. I've extended HighLowDataset for other things. Have yet to extend the CandlestickRenderer. I've extended JFreeChartPanel to handle mouseAdapter so that I can draw trend lines on the charts. I've also extended several other JFree classes.

Thanks
Mudit

Andrew Perepelytsya

Re: Candlestick candle width

Post by Andrew Perepelytsya » Wed May 15, 2002 1:04 pm

Hello, there.

Nice to see people actively working on JFreeChart. Mudit, your note about the Equivolume charts is quite intriguing. If u came across interesting links with general info on the topic, could u pleaze drop it here. It really adds some value to candlestick charts.

BTW, may I draw the developers' attention. It seems that stock charts section could bring some money to the project. My opinion is companies using JFreeChart for stock applications are more willing to pay for docs or whatever if it is worth it. And with the project's open architecture it's quite feasible to add more features to the package.

I understand we r all busy people, I do not require to drop all ur efforts into this section. But there has been some active discussion on the forum concerning different aspects of stock charts.

It would be nice to start a thread with people's wishes and experience in this area.

Mudit Wahal

Re: Candlestick candle width

Post by Mudit Wahal » Wed May 15, 2002 2:40 pm

Hi Andrew,

I started working on Java and JFreeCharts last month. I had no prior knowledge of either :-). Ask David, how I used to bug him with my silly questions regarding java and JFreeChart. I've been programming in C for last 12+ years though. Not new to programming/hacking. Just new to Java.

Now, I've some understanding for both. I've developed a stock charting application which gets data from sql server via jdbc and dynamically updates the charts. No technical indicators yet. I can draw trendlines but can't seems to zoom in/out when the chart is being zoomed. Dont know where is the reference to handle zoom in/out.

I'm interested in stock thread if you want to start it. I'm a one person company with no earnings yet so far. Once I've some, I'm more than willing to pay for docs or more features.

Regarding equivolume chart, here are some links (searched thru google).
http://www.armsinsider.com/education/ar ... _chart.asp
http://www.incrediblecharts.com/technic ... volume.htm

Thanks

Mudit

Locked