We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interesting momentum indicator based on smoothing the first derivative of price. https://school.stockcharts.com/doku.php?id=technical_indicators:true_strength_index
I crufted up a quick and dirty version to play with. Leaving this as a placeholder for a proper version when i get time
TSI <- function(x, n.first = 25, n.second = 13, n.signal = 7) { #True Strength Indicator #https://school.stockcharts.com/doku.php?id=technical_indicators:true_strength_index x <- try.xts(x, error = as.matrix) pc <- x - lag.xts(x, na.pad = T) #force lag.xts to get na padding dspc <- EMA(EMA(pc, n = n.first), n = n.second) dsapc <- EMA(EMA(abs(pc), n = n.first), n = n.second) tsi <- 100 * (dspc/dsapc) signal <- EMA(tsi, n = n.signal) r <- cbind(tsi, signal) r <- reclass(r, x) if (!is.null(dim(r))) colnames(r) <- c("tsi", "signal") return(r) } addTSI <- newTA(TSI, preFUN = Cl, col = c("blue", "red"))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
interesting momentum indicator based on smoothing the first derivative of price.
https://school.stockcharts.com/doku.php?id=technical_indicators:true_strength_index
I crufted up a quick and dirty version to play with. Leaving this as a placeholder for a proper version when i get time
The text was updated successfully, but these errors were encountered: