Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Carregar pacote de importação de dados da bolsa
- library(BatchGetSymbols)
- # Inputs
- # data inicial
- first.date <- as.Date("2017-01-01")
- #data final
- last.date <- Sys.Date()
- #frequencia das observações
- freq.data <- 'daily'
- # Ativos a serem baixados
- tickers <- c("^BVSP","PETR4.SA","^GSPC")
- #função que baixa ativos
- ativos <- BatchGetSymbols(tickers = tickers,
- first.date = first.date,
- last.date = last.date,
- freq.data = freq.data,
- cache.folder = file.path(tempdir(),
- 'BGS_Cache') )
Add Comment
Please, Sign In to add comment