Does there exist runPercentRank like runFun (runMin, runMax,...) in TTR or how to write one?
I am looking for percent rank function in R but can not find it.
Actually I am interested in runPercentRank function like the ones in TTR
package under runFun (runMin
, runMax
,...). The function would take an xts
object as argument and length of interval and return an 开发者_StackOverflow中文版xts
object with percent ranks of values.
Does something like that exists? Any hints on how to efficiently write such a function?
Thanks to Charlie Friedemann, there is now an extremely fast runPercentRank
function in TTR >= 0.22.0.
library(quantmod)
data(ttrc)
pr <- runPercentRank(Cl(ttrc))
plot(pr, type="l")
精彩评论