Learn R Programming

avfintools (version 0.1.0)

RSI: Relative Strength Index

Description

Returns the Relative Strength Index with adjustable periods

Usage

RSI(df, periods, current = FALSE, pricechange = NULL, hideprints = TRUE)

Value

Returns a vector of RSI calculations in dataframe format. If current = TRUE, returns the most recent RSI.

Arguments

df

Dataframe with price data

periods

Calculation Period

current

If one wants to input the latest price point before data updates, RSI uses the percentage return at the end of the market hours

pricechange

Input in percentage

hideprints

If TRUE, hides printouts from the current message

Examples

Run this code
RSI(SPY15, 14)
RSI(tail(SPYdaily,200), 14, current = TRUE, pricechange = 1.3)

Run the code above in your browser using DataLab