ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How to save RSI value into system/database
Posted by Sagar on Aug-21-2015 14:31
Hi,

I am currently using chartdirector for plotting stock charts. RSI indicator is getting plotted perfectly but I am looking for a way to save this value into database so that I can reuse it.

Can you please tell me how to save this value? Also, can you please provide the formula that is currently being used to calculate RSI in chartdirector?

  Re: How to save RSI value into system/database
Posted by Peter Kwan on Aug-22-2015 02:27
Hi Sagar,

As the purpose of ChartDirector is to plot charts, not as a financial computation or
calculation library, the API is not designed to directly return the RSI values. However, the
following method may be used to retrieve the values of any data set:

When you create the RSI indicator using FinanceChart.addRSI, it will return an XYChart
object representing the RSI indicator chart. The XYChart.getLayer method can be used
to retrieve the layers in the chart, then the XYChart.getDataSet can be used to retrieve
the data set within the layer, and finally the DataSet.getValue can be used to retrieve
the values of the data set. For the RSI chart, there should be a data set representing
the RSI line.

If you are using an edition of ChartDirector that contains desktop application sample code
(eg. the .NET, Java and C++ edition), there should be a sample program Finance Chart
Track Line (Windows)" that demonstrates how to use the above method to obtain the
RSI values at the track line position.

The formula for the RSI is just the standard formula. It is not invented by us. The formula
can be found using Google:

https://en.wikipedia.org/wiki/Relative_strength_index

The ChartDirector distribution includes the source code of the FinanceChart class library.
The exact location depends on your programming language edition of ChartDirector.
Please refer to the documentation for "FinanceChart" for details. The source code
includes an implementation of the above formula in the FinanceChart.addRSI method.

Hope this can help.

Regards
Peter Kwan