[R-SIG-Finance] Error with getSymbols('SP500', from = "2020-01-01", to = "2021-06-30", src='FRED') SP500<-na.locf(SP500, na.rm = TRUE)
Joshua Ulrich
jo@h@m@u|r|ch @end|ng |rom gm@||@com
Mon Nov 7 17:33:15 CET 2022
Hi Frank,
These both work for me in R-4.2.1 and quantmod 0.4.20. It looks like
you're using quantmod <= 0.4.18.
What R version are you using? At minimum, you should reinstall the
packages that were built in R-3.5.3 in March-2019.
Best,
Josh
On Mon, Nov 7, 2022 at 10:26 AM Frank <frankm60606 using gmail.com> wrote:
>
> In running:
>
>
> ##
> ## Get S&P_500 from FRED
> ##
>
> getSymbols('SP500', from = "2020-01-01", to = "2021-06-30",src='FRED')
> SP500<-na.locf(SP500,na.rm = TRUE)
> tail(SP500)
> file_name <- "SP500.csv"
> write.zoo(SP500, file = file_name, append = FALSE, quote = TRUE, sep = ",")
> quit()
>
> I get:
>
> > library(quantmod)
> Loading required package: xts
> Loading required package: zoo
>
> Attaching package: 'zoo'
>
> The following objects are masked from 'package:base':
>
> as.Date, as.Date.numeric
>
> Loading required package: TTR
> Warning messages:
> 1: package 'xts' was built under R version 3.5.3
> 2: package 'zoo' was built under R version 3.5.3
> 3: package 'TTR' was built under R version 3.5.3
> > library(chron)
> NOTE: The default cutoff when expanding a 2-digit year to a 4-digit year
> will change from 30 to 69 by Aug 2020 (as for Date and POSIXct in base R.)
> Warning message:
> package 'chron' was built under R version 3.5.3
> >
> >
> > ##
> > ## Get S&P_500 from FRED
> > ##
> >
> > getSymbols('SP500', from = "2020-01-01", to = "2021-06-30",src='FRED')
> 'getSymbols' currently uses auto.assign=TRUE by default, but will use
> auto.assign=FALSE in 0.5-0. You will still be able to use 'loadSymbols' to
> automatically load data. getOption("getSymbols.env") and
> getOption("getSymbols.auto.assign") will still be checked for alternate
> defaults.
>
> This message is shown once per session and may be disabled by setting
> options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.
>
> Error in getSymbols.FRED(Symbols = "SP500", env = <environment>, verbose =
> FALSE, :
> Unable to import "SP500".
> schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE
> (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is
> received (e.g. handshake failed).
> Calls: getSymbols -> do.call -> getSymbols.FRED Execution halted
>
> I got correct data as recently as
>
> 11/2/2022 44867 3759.69 3759.69 3759.69 3759.69 3759.69 3759.69
>
> Similar thing with getSymbols('DGS3MO',src='FRED').
>
> They both download correctly directly from FRED.
>
> Thanks,
>
> Frank
> Chicago
>
> _______________________________________________
> R-SIG-Finance using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
--
Joshua Ulrich | about.me/joshuaulrich
FOSS Trading | www.fosstrading.com
More information about the R-SIG-Finance
mailing list