But in quantmod function
OK, Bad example. But try it for the ticker "^RUT" (Russel index) There ARE options: http://finance.yahoo.com/q/op?s=^RUT+Options Also options for the S&P mini "^XAP" http://finance.yahoo.com/q/op?s=^XSP+Options getOptionChain("^XSP", NULL) Error in from:to : NA/NaN argument I'VE FOUND THE BUG. But don't know how/where to submit it. Look carefully at the URLs used by yahoo. For a stock For an index Notice that with an index, the "+options" part is there. Try calling the page without it and it fails. The current code in quantmod doesn't add this. I think we just need add one line: Symbols <- paste(Symbols, "+options", sep="") -N
On 11/15/10 7:03 PM, Cedrick Johnson wrote:
There are technically SPX cash optns. I am not in front of my comp to look them up but they do exist indeed. SPY and DIA options do exist for the ETF's.... -c Sent from my BlackBerry? -----Original Message----- From: Marc Delvaux<mdelvaux at gmail.com> Sender: r-sig-finance-bounces at stat.math.ethz.ch Date: Mon, 15 Nov 2010 18:49:35 To: Noah Silverman<noah at smartmediacorp.com> Reply-To: mdelvaux at gmail.com Cc:<r-sig-finance at stat.math.ethz.ch> Subject: Re: [R-SIG-Finance] But in quantmod function That is because there are no options on these specific tickers, as you can see by the grayed out "options" link on the corresponding yahoo page. For options on the S&P, you need to use "SPY", and "^DJX" for the DJIA. On Mon, Nov 15, 2010 at 5:06 PM, Noah Silverman<noah at smartmediacorp.com>wrote:
Hi,
I think I've found a bug in the quantmod library.
The function "getOptionChain" fails when fetching the chain of an index
(S&P, DJIA, etc.)
(Note: It works beautifully for options on stocks.)
chain<- getOptionChain("^GSPC", Exp=NULL)
Error in strsplit(opt, "<tr.*?>")[[1]] : subscript out of bounds
chain<- getOptionChain("^RUT", Exp=NULL)
Error in from:to : NA/NaN argument
Any ideas?
-N
_______________________________________________ R-SIG-Finance at stat.math.ethz.ch 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.
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at stat.math.ethz.ch 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.