Relative Strength Index (RSI).
For a list of all members of this type, see RSI Members.
System.Object
RQuant.Indicator.TTimeArray
RQuant.Indicator.TDoubleArray
RQuant.Indicator.TIndicator
RQuant.Indicator.RSI
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
The Relative Strength Index, developed by Welles Wilder is a special form of the Momentum and probably the most widely used contra-trend-oscillator. Contrary to the implications of its name, the indicator does not show the instrument?s strength in comparison to other instruments, but rather the instrument?s internal strength compared to its former prices.
The RSI is calculated in several steps: within a given period, the individual differences between the upward closing prices (Close today > Close yesterday) and downward closing prices (Close today less than Close yesterday) are added up and afterwards divided by the number of observations minus one. The result is the day?s mean value of the upward and downward strength of the underlying instrument. Thereafter, the relative strength is calculated by dividing the average upward strength by the average downward strength. Finally, you arrive at the RSI by subtracting from 100 the quotient of 100 divided by 1 plus relative strength.
This indicator is described in more details in the Steve Achelis' book "Technical Analysis from A to Z".
Note, that there are two styles of indicator RSI. Some trading systems use the formula (which is a little bit distinguished from classical) for calculation of this indicator. Therefore Quant Studio gives an opportunity to use two styles RSI - classical (QuantStudio style) and little bit changed (MetaStock style.)
RSI has QuantStudio style by Default.
Formula for Quant Studio (classical) style:
TDataManager.cd("Demo");
TDailyArray Daily1 = TDataManager.GetStock("YHOO").DailyArray;
DateTime Date1 = DateTime.Parse("1999/02/08");
DateTime Date2 = DateTime.Parse("2000/12/29");
TDailyArray Daily = Daily1.Clone(Date1, Date2);
TCanvas Canvas = new TCanvas("Canvas","RSI DEMO",600,400);
Canvas.Divide(1,2);
RSI RSI = new RSI(Daily, 14);
Canvas.cd(1);
Daily.Draw("c");
Canvas.cd(2);
RSI.Draw(Color.Red);
Formula for MetaStock style:
TDataManager.cd("Demo");
TDailyArray Daily1 = TDataManager.GetStock("YHOO").DailyArray;
DateTime Date1 = DateTime.Parse("1999/02/08");
DateTime Date2 = DateTime.Parse("2000/12/29");
TDailyArray Daily = Daily1.Clone(Date1, Date2);
EIndicatorStyle Style = EIndicatorStyle.MetaStock;
TCanvas Canvas = new TCanvas("Canvas","RSI DEMO",600,400);
Canvas.Divide(1,2);
RSI RSI = new RSI(Daily, 14, Style);
Canvas.cd(1);
Daily.Draw("c");
Canvas.cd(2);
RSI.Draw(Color.Red);
Namespace: RQuant.Indicator
Assembly: RQuant.Indicator (in RQuant.Indicator.dll)
RSI Members | RQuant.Indicator Namespace