Relative Strength Index (RSI)
Overview
The Relative Strength Index (RSI) is a financial technical analysis momentum oscillator measuring the velocity and magnitude of directional price movement by comparing upward and downward close-to-close movements.
AnyChart Stock allows you to add RSI with desired period to any of your charts.
Mathematical description of the indicator please see at: Mathematical Description of Technical Indicators
Adding indicator
To add any indicator to the chart, you need to use Data Provider with the fields required by the indicator.
When such Data Provider is ready - you can add indicator to the chart.
Preparing Data Provider
RSI indicator needs Data Provider with Close or Value fields.
Sample XML of Data Provider, which can be used to create RSI indicator:
Indicator Declaration
As soon as Data Provider is ready you can add an indicator to a chart.
RSI indicator is usually
shown on the chart below the chart with data (stock data). So we should declare it in another chart. Learn more about charts and layout in Chart Layout article.
XML for RSI declaration, note that there are two charts defined - one is used to show the stock data, and another one contains technical
indicator:
01 |
<?xml version="1.0" encoding="UTF-8"?> |
02 |
< stock xmlns = "http://anychart.com/products/stock/schemas/1.9.0/schema.xsd" > |
Another important thing is the fact that RSI is measured on a 0 - 100 scale, so to show it properly we need to configure value axis scale in the chart with indicator, like that, for example:
Of course you can use other steps or margins, if you'd like to, as described in Y-Axes Settings article.
After all things mentioned above are done, you can create a chart with RSI indicator, see basic Live Sample with it below:
Live Sample: Technical Indicators - Adding RSI Indicator
Indicator parameters
Relative Strength Index has only one type specific parameter - period. Period is set in <rsi_indicator> node,
where all settings for RSI indicator are set.
XML for setting RSI period:
As you can see you just need to set period attribute in <rsi_indicator> node,
this attribute accepts any integer greater than 1.
Live sample below shows RSI(30):
Live Sample: Technical Indicators - RSI Parameters
Visualization
To visualize and tune visualization of technical indicators AnyChart Stock Component uses the same methods as for
the data series.
By default RSI is shown as series of Line type, but you can use almost any of available series types to show it on
the chart - Spline, Area or Stick, for example.
RSI indicator settings are contained in <rsi_indicator> node, also in this node you can
put <series> subnode - this node defines how exactly indicator is displayed on the chart. This node is
identical to <series> node used to describe data series, so you can do with indicator anything you can do
with series.
Sample XML for changing indicator visualization:
06 |
< name > <![CDATA[ Relative Strength Index(30) ]]> </ name > |
11 | name: "Relative Strength Index(30)" , |
Live sample below shows settings shown above:
Live Sample: Technical Indicators - RSI Visualization Settings
Overbought/Oversold Visualization
RSI can be used to determine if there is too much or too little volume associated with a security. A stock is considered
"overbought" if the RSI indicator reaches 70 and above, and if RSI is 30 and below it is suggested that a stock is "oversold".
To chart Overbought and Oversold signals in AnyChart Stock you can use Line or Range axis markers with labels, which are described in
Live sample below shows RSI with labeled line axis markers used to highlight Overbought and Oversold signals:
Live Sample: Technical Indicators - RSI with Overbought and Oversold Signals