|
How to convert my chart to be able to draw on indicators like line, fibonacci |
Posted by tunde on Jan-25-2013 22:52 |
|
Hi Peter,
I want to be able to draw indicators on my chart, how can i get this done in my window application.
thanks |
Re: How to convert my chart to be able to draw on indicators like line, fibonacci |
Posted by Peter Kwan on Jan-26-2013 02:56 |
|
Hi tunde,
Do you mean you would like to add some "fibonacci lines" to your chart?
From my understand, "fibonacci lines" are just straight lines. You can add them to the chart just like any other lines. First, compute the values for the lines, then add them using a method that can add lines, such as FinanceChart.addLineIndicator2 (if you are drawing a FinanceChart), XYChart.addLineLayer, BaseChart.addLine, Axis.addMark (for horizontal lines only), etc..
For your reference, the thread below shows some ChartDirector charts with "fibonacci lines". (The images are from one of our customers. We do not have their code.)
http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1213000551
Hope this can help.
Regards
Peter Kwan |
Re: How to convert my chart to be able to draw on indicators like line, fibonacci |
Posted by Chandra on Jan-17-2014 17:28 |
|
HI peter..
Can you please provide me sample code to draw Fibonacci arc ,in c++.
Thanks
Chandra |
Re: How to convert my chart to be able to draw on indicators like line, fibonacci |
Posted by Peter Kwan on Jan-18-2014 02:22 |
|
Hi Chandra,
Set the clip region to the plot area (using DrawArea.setClipRect), and then just draw a
circle or ellipse (using DrawArea.circle). For example:
... create main price chart as usual .....
$d = $mainPriceChart->makeChart3();
$centerX = $mainPriceChart->getXCoor($arrayIndexOfPoint - $extraPoint);
$centerY = $mainPriceChart->getYCoor($price);
$p = $mainPriceChart->getPlotArea();
$d->setClipRect($p->getLeftX(), $p->getTopY(), $p->getTopX(), $p->getBottomY());
$d->circle($centerX, $centerY, $xRadius, $yRadius, 0xff0000, Transparent);
.... add more circles ....
$d->setClipRect(0, 0, $mainPriceChart->getWidth() - 1, $mainPriceChart->getHeight() - 1);
Hope this can help.
Regards
Peter Kwan |
Re: How to convert my chart to be able to draw on indicators like line, fibonacci |
Posted by subh on Jan-28-2014 18:56 |
|
Hi Peter
Thanks for your replay.
Now i am trying to draw Fibonacci arc.
for that i want to use draw area Arc() method.
but in that my doubt is how to get Angel?
i have x1,x2,y1,y2
arc(x1,y1,x2,y2, Angel, Angel,255);
please help..
thanks
chandra |
Re: How to convert my chart to be able to draw on indicators like line, fibonacci |
Posted by Peter Kwan on Jan-28-2014 23:54 |
|
Hi subh,
The angles are input parameters that you would need to determine. ChartDirector cannot
determine the angles for you, just like ChartDirector cannot determine the stock price for
you. Your code would need to get the stock price to plot a price chart, and it would need
to determine the angles to plot a Fibonacci arc.
I used google to search images using "Fibonacci arc" as the keyword. Most of the charts I
seen are using 90 to 270 as the angles, or -90 to 90 as the angles, depending on whether
you use the high point or low point as the center.
Regards
Peter Kwan |
|