joshuaulrich / TTR

Technical analysis and other functions to construct technical trading rules with R
GNU General Public License v2.0
326 stars 102 forks source link

runPercentRank(cumulative=TRUE) does not NA the initialization period #73

Closed httassadar closed 3 years ago

httassadar commented 5 years ago

Version 0.23-3

TTR::runPercentRank(1:10, n = 5, cumulative = TRUE) [1] 0.5000000 0.7500000 0.8333333 0.8750000 0.9000000 0.9166667 0.9285714 0.9375000 0.9444444 [10] 0.9500000

with cumulative=FALSE, it works fine

TTR::runPercentRank(1:10, n = 5, cumulative = FALSE) [1] NA NA NA NA 0.9 0.9 0.9 0.9 0.9 0.9