com.exponto.jstock.indicators
Class RsiAlgorithm

java.lang.Object
  |
  +--com.exponto.jstock.indicators.RsiAlgorithm

public class RsiAlgorithm
extends java.lang.Object

Computes the RSI values for a LogDataSeries. Updates the rsiparameters with start and stop dates for the current series.

Author:
ttranu

Constructor Summary
RsiAlgorithm()
           
 
Method Summary
static java.util.ArrayList findRSIClassicWay(LogDataSeries lDS, RsiParameters rsiParam)
          Note that for days with out trading the RSI value of the previous day is stored
static java.util.ArrayList findRSINewWay(LogDataSeries logDS, RsiParameters rsiParam)
          Note: Sources on the internet does not agree on how to compute RSI The formula itself is not the problem, it is: RSI = 100 - [100/(1+RS)] where...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RsiAlgorithm

public RsiAlgorithm()
Method Detail

findRSINewWay

public static java.util.ArrayList findRSINewWay(LogDataSeries logDS,
                                                RsiParameters rsiParam)
Note: Sources on the internet does not agree on how to compute RSI The formula itself is not the problem, it is: RSI = 100 - [100/(1+RS)] where... RS = Average of up day's closes / Average of down day's closes It's the RS part that is the problem - does avarage of up day closes mean sum of positive changes divided by number of days with positive changes or divided by the whole periode? It seems that historically the RS part has been computed in a special way. The first value of RSI was computed with division of the whole peridode. The next value was computed by multiplying the previous value with periode -1, then adding/subtracting the new price change and then divide again by the whole periode. By this way a price change once used in the calculation is never completly forgotten. By this way the resulting RSI will vary depending on where you start your calculation. I have (tried to) implement both, methodes are called findRSINewWay and findRSIOldWay respectivly. A second note: This is my interpretation of several source found on the internet, among them: - ETF Authority Educational Archive -- THE RELATIVE STRENGTH INDEX (RSI) http://www.streetauthority.com/terms/technicalanalysis/rsi.asp - The Investment FAQ is a collection of frequently asked questions and answers about investments and personal finance. This is a plain-text version of The Investment FAQ, part 17 of 20. The web site always has the latest version, including in-line links. Please browse http://invest-faq.com/


findRSIClassicWay

public static java.util.ArrayList findRSIClassicWay(LogDataSeries lDS,
                                                    RsiParameters rsiParam)
Note that for days with out trading the RSI value of the previous day is stored

Parameters:
lDS -
Returns:
an ArrayList with the RSI values


Copyright © 2004 Kaare Ranum