[R-SIG-Finance] quantmod::getOptionChain() errors

Jeff Ryan jeff.a.ryan at gmail.com
Wed Oct 10 23:57:58 CEST 2012


> getOptionChain("F")
$calls
                 Strike Last   Chg  Bid  Ask  Vol    OI
F121020C00001000    1.0 9.07  0.00 8.90 9.20    2     1
F121020C00006000    6.0 4.30  0.00 3.95 4.00    5   182
F121020C00007000    7.0 3.00  0.00 2.97 3.00   10   753
F121020C00008000    8.0 1.98 -0.13 1.97 2.00  145  1781
F121020C00009000    9.0 0.98 -0.11 0.98 1.00 2489 16158
F121012C00009500    9.5 0.56  0.01 0.47 0.50  177  1164
F121012C00010000   10.0 0.06 -0.08 0.06 0.08 1029  3054
F121020C00010000   10.0 0.14 -0.07 0.13 0.14 2539 77492
F121012C00010500   10.5 0.01  0.00   NA 0.01  155  7191
F121012C00011000   11.0 0.01  0.00   NA 0.02    1   250
F121020C00011000   11.0 0.01  0.00 0.01 0.02  823 68043
F121012C00011500   11.5 0.01  0.00   NA 0.01    8     8
F121020C00012000   12.0 0.01  0.00   NA 0.02    2  5342
F121020C00013000   13.0 0.01  0.00   NA 0.01    2  3035
F121020C00014000   14.0 0.02  0.00   NA 0.01    1   161

$puts
                 Strike Last  Chg  Bid  Ask  Vol    OI
F121020P00005000    5.0 0.03 0.00   NA 0.01  329   329
F121020P00007000    7.0 0.01 0.00   NA 0.02   50  1382
F121020P00008000    8.0 0.01 0.00   NA 0.02    1 16347
F121020P00009000    9.0 0.01 0.00 0.01 0.02   20 24760
F121012P00009500    9.5 0.01 0.00   NA 0.01  125   162
F121012P00010000   10.0 0.10 0.04 0.07 0.09 2250 10813
F121020P00010000   10.0 0.17 0.06 0.14 0.16 3249 25705
F121012P00010500   10.5 0.53 0.14 0.50 0.53    8  1079
F121012P00011000   11.0 1.03 0.10 1.00 1.02   89     5
F121020P00011000   11.0 1.03 0.10 1.01 1.04  148 11512
F121020P00012000   12.0 2.03 0.11 2.01 2.03   94  1271
F121020P00013000   13.0 3.17 0.00 3.00 3.05    1   941
F121020P00014000   14.0 4.10 0.00 4.00 4.05    1    30
F121020P00015000   15.0 4.95 0.00 5.00 5.05    4     4
F121020P00016000   16.0 6.55 0.00 5.65 6.10    1    39

$symbol
[1] "F"

> packageVersion("quantmod")
[1] ‘0.3.20’
> Sys.time()
[1] "2012-10-10 16:53:41 CDT"

Works for me, at the moment.

Make sure the data is really coming back. You may have some other
issue in the connection. Or just bad luck in terms of which Yahoo
server that got hit.

Also, MNT isn't valid in Yahoo land.  So that is failing for other reasons.

http://finance.yahoo.com/lookup?s=mnt

Jeff



On Wed, Oct 10, 2012 at 4:37 PM, rex <rex at nosyntax.net> wrote:
> getOptionChain("F")
> Error in puts[, 2] : incorrect number of dimensions
> getOptionChain("MNT")
> Error in strsplit(opt, "<tr")[[1]] : subscript out of bounds
>
>> sessionInfo()
>
> R version 2.15.1 (2012-06-22)
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               [3]
> LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     [5]
> LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    [7] LC_PAPER=C
> LC_NAME=C                  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> other attached packages:
> [1] plyr_1.7.1      XML_3.9-4       RCurl_1.95-0.1  bitops_1.0-4.1 [5]
> quantmod_0.3-20 TTR_0.21-1      xts_0.8-6       zoo_1.7-7      [9]
> Defaults_1.1-1
> loaded via a namespace (and not attached):
> [1] grid_2.15.1    lattice_0.20-6 tcltk_2.15.1   tools_2.15.1
> -rex
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.



-- 
Jeffrey Ryan
jeffrey.ryan at lemnica.com

www.lemnica.com



More information about the R-SIG-Finance mailing list