Closed siims-biz closed 7 years ago
You didn't find such a parameter in the documentation because one doesn't exist. For technical indicators, it is generally a very bad idea to align the output to anything other than the last observation in the period. Anything else has a very real potential to create look-ahead bias.
If you really want to do this, you should use zoo::rollmean
.
R> zoo::rollmean(kurs, 3, fill = NA, align = "left")
[1] 2 3 4 5 NA NA
I'm closing this because I'm not comfortable adding it as a feature, and alternatives alrady exist.
In the documentation I did not find a parameter to move the NA to the end. Is there one around?
Default output NA NA 2 3 4 5 With additional parameter the output changes to 2 3 4 5 NA NA