Rick
Rick

Reputation: 181

Quantmod/getOptionChain Error in .Date(Exp/86400) : could not find function ".Date"

I'm getting an error when running getOptionChain from quantmod package.

The code should get Option chain data and subset into a new list that contains only the puts.

The error I get is: Error in .Date(Exp/86400) : could not find function ".Date"

Same code, sometimes runs without error. If I shorten the list of Symbols, there's no error, but the error as far as I know is not related to a specific symbol, because I made to run successfully. Seems random but frequent error.

All symbols are weekly expirations and the desired output is the next weekly expiration, so from my understanding, there's no need to specify a exp date.

library(quantmod)

library(xts)

Symbols<-c ("AA","AAL","AAOI","AAPL","ABBV","ABC","ABNB","ABT","ACAD","ACB","ACN","ADBE","ADI","ADM","ADP",
"ADSK","AEO","AFL","AFRM","AG","AGNC","AHT","AIG","AKAM","ALGN","AMAT","AMBA","AMC","AMD","AMGN",
"AMPX","AMRN","AMRS","AMZN","ANET","ANF","ANY","APA","APO","APPH","APPS","APRN","APT","AR","ARVL")

Options.20221118 <- lapply(Symbols, getOptionChain)

names(Options.20221118) <- Symbols

only_puts_list <- lapply(Options.20221118, function(x) x$puts)

Upvotes: 0

Views: 66

Answers (1)

Rick
Rick

Reputation: 181

After upgrading to R 4.2.2 the issue is fixed.

Upvotes: 1

Related Questions