RSI {TTR}R Documentation

Relative Strength Index

Description

The Relative Strength Index (RSI) calculates a ratio of the recent upward price movements to the absolute price movement. Developed by J. Welles Wilder.

Usage

  RSI(price, ma.up=list("EMA", n=14, wilder=TRUE), ma.down=ma.up)

Arguments

price Price series to use.
ma.up A list whose first component is a string containing the upward price movement moving average function name; additional parameters may also be specified as named components.
ma.down Similar to ma.up, but for the downward price movement moving average.

Details

The RSI calculation is RSI = 100 - 100 / ( 1 + RS ), where RS is the smoothed ratio of ‘average’ gains over ‘average’ losses. The ‘average’ aren't true averages, since they're divided by the value of n not the number of gain/loss periods.

Value

A vector containing the RSI values.

Note

The RSI is usually interpreted as an overbought/oversold (over 70 / below 30) indicator. Divergence with price may also be useful. For example, if price is making new highs/lows, but RSI is not, it could indicate a reversal.

You can calculate a stochastic RSI by using the function stochastic on RSI values.

Author(s)

Josh Ulrich

References

The following site(s) were used to code/document this indicator:
http://www.fmlabs.com/reference/RSI.htm
http://www.equis.com/Customer/Resources/TAAZ/?c=3&p=100
http://linnsoft.com/tour/techind/rsi.htm
http://stockcharts.com/education/IndicatorAnalysis/indic_RSI.html

See Also

See EMA, SMA, etc. for moving average options; and note Warning section. See CMO for a variation on RSI.

Examples

  data(ttrc)
  rsi <- RSI(ttrc[,"Close"])

[Package TTR version 0.13-1 Index]