SHARE
TWEET

Untitled

a guest Dec 13th, 2018 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Pacotes necessários ----------------------------------------------
  2. library(BatchGetSymbols)
  3. library(quantmod)
  4. # Inputs necessários ------------------------------------------------------
  5. #data inicial
  6. first.date <- as.Date("2018-01-01")
  7. #data final
  8. last.date <- Sys.Date()
  9. #frequencia das observações
  10. freq.data <- 'daily'
  11. # Ativos a serem baixados
  12. tickers <- c("^BVSP")
  13. # Importando ativos -------------------------------------------------------
  14. ibov <- BatchGetSymbols(tickers = tickers,
  15.                       first.date = first.date,
  16.                       last.date = last.date,
  17.                       freq.data = freq.data,
  18.                       cache.folder = file.path(tempdir(),
  19.                                                'BGS_Cache') )
  20. ibov<-as.data.frame(ibov)
  21.    
  22. chartSeries
  23.    
  24. ibov<-xts(ibov, order.by = ibov$df.tickers.ref.date)
  25. chartSeries(ibov)
  26.    
  27. Error in (function (cl, name, valueClass)  :
  28. assignment of an object of class “character” is not valid for @‘yrange’ in
  29. an object of class “chob”; is(value, "numeric") is not TRUE
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top