1
$\begingroup$

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?

$\endgroup$
1
$\begingroup$

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
}
$\endgroup$
0
$\begingroup$

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)

For more information on the Wilder Moving Average - https://www.incrediblecharts.com/indicators/wilder_moving_average.php

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.