download_french_list <- function() {
ff_5 <- download_french('F-F_Research_Data_5_Factors_2x3_daily_CSV.zip', 2)
ff_mo <- download_french('F-F_Momentum_Factor_daily_CSV.zip', 12)
ff_ind_12 <- download_french('12_Industry_Portfolios_daily_CSV.zip', 9)
res <- list()
res$ff_5 <- ff_5[, 1:6]
res$ff_mo <- ff_mo
res$ff_ind_12 <- ff_ind_12
res$ff_rf <- ff_5[, c(1, 7)]
return(res)
}
ticker <- c('ivv', 'iwm', 'vtv', 'iwf', 'efa', 'vwo', 'tlt', 'ief', 'emb',
'lqd', 'hyg', 'vnq', 'amj', 'igf', 'gnr', 'gld')
etf_list <- lapply(ticker, download_tiingo, tiingo_api = t_api)
ret <- combine_time_series(etf_list, freq = 'd', input_list = TRUE)
ff <- download_french_list()
rf <- download_fred('DGS3MO')
rf$DGS3MO <- price_fill_na(rf$DGS3MO)
rf$DGS3MO <- (1 + rf$DGS3MO / 100)^(1 / 252) - 1
rf$date <- as.Date(rf$date)
save(ret, file = './data/ETF.RData')
save(ff, file = './data/FF.RData')
save(rf, file = './data/RF.RData')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.