stochRSI: Stochastic RSI

Description Usage Arguments Details Value Examples

View source: R/technical_indicators.R

Description

This stochastic RSI matches IB's stoch RSI. Needs a minimum of (2 * n) 28 days of price action before the numbers start working, but this is about 2.5 times faster than using (RSI(adm$close, 14) - runMin(RSI(adm$close, 14))) / (runMax(RSI(adm$close, 14)) - runMin(RSI(adm$close, 14))) and gives only 4 days extra info.

Usage

1
stochRSI(x, n = 14L)

Arguments

x

Price series that is coercible to xts or matrix

n

Number of periods. Default is 14.

Details

It is a measure of RSI relative to its own high/low range over a user defined period of time. The Stochastic RSI is an oscillator that calculates a value between 0 and 1 which can be plotted as a line. This indicator is primarily used for identifying overbought and oversold conditions.

Value

The stochRSI function will return a timeseries with values ranging between 0 and 1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(quantmod)
ADM <- getSymbols("ADM", 
                  from = "2018-01-01", 
                  to = "2018-07-01",
                  auto.assign = FALSE)
chartSeries(ADM, TA = NULL) # without volume
addTA(stochRSI(Cl(ADM)))

## End(Not run)

pverspeelt/Quantfunctions documentation built on Oct. 10, 2021, 1:01 p.m.