# NOT RUN {
library(tidyverse)
library(tidyquant)
library(timetk)
FANG %>%
select(symbol, date, adjusted) %>%
group_by(symbol) %>%
tk_augment_slidify(
.value = adjusted,
# Multiple rolling windows
.period = c(10, 30, 60, 90),
.f = AVERAGE,
.partial = TRUE,
.names = str_c("MA_", c(10, 30, 60, 90))
)
# }
Run the code above in your browser using DataLab