joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
798 stars 219 forks source link

getOptionChain function is returning NA on bid ask for ETF's #365

Closed ghost closed 1 year ago

ghost commented 1 year ago

Description

Whenever I run getOptionChain(...) on a vector of assets. I'm only getting the data for stocks, but for ETF's like SPY and QQQ, the bid ask prices for the options is NA.

Expected behavior

Screenshot 2022-11-17 at 15 36 31

As you can see here with AAL ticker, we have all bid and ask prices.

Erroneous Behavior

Screenshot 2022-11-17 at 15 37 49

And here is the output for SPY. Note that there are option for 2022-11-17, so it's not a problem that the option's expiry does not exist. See the image below for the market data for SPY for the mentioned date.

Screenshot 2022-11-17 at 15 28 16

Minimal, reproducible example

asset_options <- getOptionChain(c("AAL", "SPY"))

Session Info

Screenshot 2022-11-17 at 15 34 09

joshuaulrich commented 1 year ago

Yahoo doesn't show bid/ask prices for them on its website either. So I'm closing this because I don't think there's anything I can do. I'm happy to continue discussing it though.

Regardless, these expire today. I wouldn't trust their prices enough to use them. I'm not familiar with options on ETFs, but it's possible their last trading day and settlement procedures are different than stocks.

image