Closed evelynmitchell closed 3 years ago
CTI <- function(x, n = 20, slope = 1) {
x <- try.xts(x, error = as.matrix)
y <- slope * seq_along(x)
r <- runCor(x = x, y = y, n = n)
return(reclass(r, x))
}
addCTI <- newTA(CTI, preFUN = Cl)
add_CTI <- newTA(CTI, preFUN = Cl)
Description
Request to add Ehler's Correlation Trend Indicator
Expected behavior
As seen in TASC 2020-05 and https://financial-hacker.com/petra-on-programming-a-unique-trend-indicator/
Minimal, reproducible example
There's tradestation code in the second link. I haven't coded it up yet.
Session Info
Thank you!