开发者

Does there exist runPercentRank like runFun (runMin, runMax,...) in TTR or how to write one?

开发者 https://www.devze.com 2023-03-30 07:35 出处:网络
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

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")
0

精彩评论

暂无评论...
验证码 换一张
取 消