# R RSI Calculation (TTR package)

I'm using the default RSI calculation in the TTR package as follows:

result = RSI(data,14).

The function also allows the user to specify the averaging method:

result = RSI(data,14,"SMA"), result = RSI(data,14, "EMA") etc.

However, I cannot work out what averaging method is being used in the default version. I have compared the results from all the different averaging methods (SMA, EMA) and none of them match the default. Any ideas?

The TTR RSI code uses EMA by default. Code below:

https://github.com/joshuaulrich/TTR/blob/master/R/RSI.R

# Default Welles Wilder EMA
if(missing(maType)) {
maType <- 'EMA'
maArgs\$wilder <- TRUE
}


The answer is that the default uses the Wilder EMA, which does act slightly different from a standard EMA.

i.e. Default = RSI(data,14,"EMA",wilder = TRUE)