|
How to retrieve the values from the indicator layers |
Posted by Aishwarya on Apr-22-2016 17:57 |
|
Hi,
I have added indicators to the FinanceChart and would like to display the values in a tabular format. is it possible to retrieve the values from the indicator layers?
Thanks in advance.
Regards,
Aishwarya Rani Rajeev |
Re: How to retrieve the values from the indicator layers |
Posted by Peter Kwan on Apr-23-2016 00:53 |
|
Hi Aishwarya,
In the FinanceChart object, you can use MultiChart.getChart to obtain the various indicator charts, then use XYChart.getLayer to obtain the layers, then use Layer.getDataSet to get the data sets, then use DataSet.getValue to get the data value.
The Finance Chart Track Line sample code is an example that uses these methods to get the data value and put them in the legend box. For your case, you can get the data values and put them a table.
Hope this can help.
Regards
Peter Kwan |
Re: How to retrieve the values from the indicator layers |
Posted by Aishwarya on May-04-2016 18:13 |
|
Hi Peter,
Thank you so much. It helped me a lot.
How can i get to know the name(name of the indicator) from the layer for which i am reading the value?
Regards,
Aishwarya Rani Rajeev |
Re: How to retrieve the values from the indicator layers |
Posted by Peter Kwan on May-05-2016 02:48 |
|
Hi Aishwarya,
The "Finance Chart Track Line" sample code mentioned in my last message also demonstrates how to obtain the indicator name. You may notice that the dynamic legend created in the sample code does contain the indicator names. It is obtained by using the API DataSet::getDataName.
Hope this can help.
Regards
Peter Kwan |
Re: How to retrieve the values from the indicator layers |
Posted by Aishwarya on Aug-09-2016 14:58 |
|
Hi,
I am able to tabulate the indicator values, but on zoom i am getting the values for the visible range of candle. How can i get the values for the fullrange?
Regards,
Aishwarya Rani Rajeev |
Re: How to retrieve the values from the indicator layers |
Posted by Peter Kwan on Aug-09-2016 23:34 |
|
Hi Aishwarya,
For the full range, are you referring to the indicator values for your full data, not just the visible part of the data?
Suppose you have 30 years of data. If the user zooms into the last 6 months, you only need to pass the last 6 months of data (plus may be 30 extra points" to compute indicators) to ChartDirector (in the FinanceChart.setData method) to plot the visible part of the chart. So ChartDirector cannot compute the indicators for full 30 years, because it only receives 6 months of data.
If you want the indicator for the full 30 years, please create another chart using the full 30 years of data, then obtain the indicator values from that chart. You can delete that chart afterwards as the full data will not be displayed.
Hope this can help.
Regards
Peter Kwan |
Re: How to retrieve the values from the indicator layers |
Posted by Aishwarya on Aug-18-2016 13:44 |
|
Hi Peter,
To retrieve the values of indicator i wanted to modify FinanceChart class and add few variable. I need to build chartdir code if i modify. How can i build the chartdir source code.
Regards,
Aishwarya Rani Rajeev |
Re: How to retrieve the values from the indicator layers |
Posted by Peter Kwan on Aug-19-2016 01:05 |
|
Hi Aishwarya,
The FinanceChart is implemented in the header file "FinanceChart.h". So you should not need to modify the ChartDirector DLL "chartdir60.dll" when you modify "FinanceChart.h". For example, in the FinanceChart.h, there is a line of code that sets the legend text for the "Open" value:
sprintf(buffer, "Op:%s", formatValue(openValue, m_generalFormat.c_str()));
If you modify it to:
sprintf(buffer, "XYZ:%s", formatValue(openValue, m_generalFormat.c_str()));
then the chart will use your format. There is no need to change the ChartDirector DLL "chartdir60.dll".
Hope this can help.
Regards
Peter Kwan |
|