Skip to content

Commit

Permalink
Update Bid & Ask fields to handle missing entries
Browse files Browse the repository at this point in the history
Similar to Vol & OI changes implemented previously. There are requests that are failing due to the bid & ask fields not having any info. This change solves.
  • Loading branch information
jrburl authored and joshuaulrich committed Nov 29, 2020
1 parent daf4cdb commit 77c4b92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/getOptionChain.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ getOptionChain.yahoo <- function(Symbols, Exp, ...)
d <- with(x, data.frame(Strike=strike,
Last=lastprice,
Chg=change,
Bid=bid,
Ask=ask,
Bid= if("bid" %in% names(x)) {bid} else {NA},
Ask= if("ask" %in% names(x)) {ask} else {NA},
Vol= if("volume" %in% names(x)) {volume} else {NA},
OI= if("openinterest" %in% names(x)) {openinterest} else {NA},
LastTradeTime= if("lasttradedate" %in% names(x)) {lasttradedate} else {NA},
Expand Down

0 comments on commit 77c4b92

Please sign in to comment.