fibonacci arcs and gann angles

Discussion about JFreeChart related to stockmarket charts.
Locked
develop
Posts: 296
Joined: Wed Mar 23, 2005 10:01 pm

fibonacci arcs and gann angles

Post by develop » Sat Feb 11, 2006 9:10 pm

hi, Please can tell me how to draw fibonacci arcs, retracements and gann angles with trendlines in JFreechart. I need to get some direction from where to start and how to add those functionality.

Thanks

Fede

Post by Fede » Mon Feb 13, 2006 9:59 am

Hi,
Drawing Fibonacci lines is not implemented in JFreeChart and you have to do it by yourself.
This can be done writing the code in the the mouseListeners methods of your ChartPanel also you can use annotations.

develop
Posts: 296
Joined: Wed Mar 23, 2005 10:01 pm

Post by develop » Mon Feb 13, 2006 2:54 pm

Thanks for reply, but how can i draw arcs on charts.?

Thanks

Guest

Post by Guest » Mon Feb 13, 2006 4:12 pm

I have not tried yet , so i can't be sure that is the best way, but maybe using XYShapeAnnotation you can plot circles. I think you must to manage yourself the drawing method to have arcs.
Sorry but i can't tell you more now.
In this followings weeks i will have to do exactly the same think(drawnig fibonnacci arcs), so if i have more information i will inform you in this topic.

develop
Posts: 296
Joined: Wed Mar 23, 2005 10:01 pm

Post by develop » Mon Feb 13, 2006 4:19 pm

Thanks for reply, Actually i was thinking the same thing. i am trying to use XYShapeAnnotation. there is one demo which draws circles. but that works on old version.( i tried to compile with new version. but didnt work).
Please do inform me if you have any information. i will do same thing as i need to implement fibonacci and gann chart in next few days.

Thanks once again

develop
Posts: 296
Joined: Wed Mar 23, 2005 10:01 pm

Post by develop » Tue Feb 21, 2006 4:11 am

hi Fede,

are you able to draw any gann chart and stuff. I am still in process and i would like to know how you convert dates into values while calculating angles and stuff?

Thanks

Fede

Post by Fede » Wed Feb 22, 2006 7:23 pm

Hi,
I'm sorry but i have not started implementing indicators yet(I'm really at begining of the application and i think i won't start implementing indicators before 1 month ).

Anyway to perform Gann lines, i think i will act like that:
I take two dates D1 and D2. D1 is the starting date (date where the gann line start) and D2 the last date (usually last of the dataset).
I take two values of range axis, V1 and V2 (V1 is min value (o)and V2 the max).
After i choice an interval for my period of time. By example i decide that one unit is one day.

we get the difference D2.getTime()-D1.getTime(). This will return a long representing the milliseconds between D1 and D2. This result must be passed to a method which can return the number of days for a number of millisecond.(We will write the same method for return hours, month.. etc depending the choice of the interval).
If the method return 365 days, we calcul (V2-V1)/365. This will give the unit of price (by example 20).
If i have not done mistake (this seems very strange) to have a line 1x1 we need 20 units of price for one day.

Carrefull i have not tested what i'm saying and not sure that is not wrong. Anyway i think this will be the way that i will take to perform it.
Hope it will help you.
Fede

Locked