[R-SIG-Finance] Getting quotes for stock options

Pete B Peter.Brecknock at bp.com
Fri Jun 4 15:35:09 CEST 2010

Looks like you need to make a few changes to Martin's code

I altered the following in the yahoo.getOption function

Quote.date <- gsub("On |:","",info.raw[sm.pos[1]+1])
Strike.date <- gsub("^ *|</td","",raw[expire[1]+1])

to ....

Quote.date <- gsub("</span","",info.raw[sm.pos[1]+2])
x= sub('Expire at close ([^ ]+)','\\1',raw[expire[1]])
Strike.date <- gsub("^ *|</td","",x)


View this message in context: http://r.789695.n4.nabble.com/Getting-quotes-for-stock-options-tp2236059p2243241.html
Sent from the Rmetrics mailing list archive at Nabble.com.

More information about the R-SIG-Finance mailing list