[R-SIG-Finance] Error with getSymbols('SP500', from = "2020-01-01", to = "2021-06-30", src='FRED') SP500<-na.locf(SP500, na.rm = TRUE)

Frank |r@nkm60606 @end|ng |rom gm@||@com
Mon Nov 7 17:26:24 CET 2022


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



More information about the R-SIG-Finance mailing list