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.
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.