joshuaulrich / quantmod

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

Update getOptionChain to handle empty volume or open interest #300

Closed jrburl closed 4 years ago

jrburl commented 4 years ago

Have seen getOptionChain fail on several occasions due to "Error in data.frame(Strike = strike, Last = lastprice, Chg = change, Bid = bid, : object 'volume' not found". (or open interest). Proposing an if else statement to check if "volume" and "openinterest" are in the table column names. If in, no changes, if out, populate with NA.

joshuaulrich commented 4 years ago

Thank you for your contribution!