[R-SIG-Finance] IB contract specification for VIX index: load fails
Jeff Ryan
jeff.a.ryan at gmail.com
Fri Sep 3 19:15:25 CEST 2010
I don't subscribe to the RT feed in this case and can't pull
historical, but what follows is the correct format for the contract.
You may simply not be able to get that from the historical side of the API.
> reqContractDetails(tws, con)
[[1]]
List of 11
$ version : chr "6"
$ contract :List of 14
..$ conId : chr "13455763"
..$ symbol : chr "VIX"
..$ sectype : chr "IND"
..$ exch : chr "CBOE"
..$ primary : chr ""
..$ expiry : chr ""
..$ strike : chr "0.0"
..$ currency : chr "USD"
..$ right : chr ""
..$ local : chr "VIX"
..$ multiplier : chr ""
..$ combo_legs_desc: chr ""
..$ comboleg : chr ""
..$ include_expired: chr ""
..- attr(*, "class")= chr "twsContract"
$ marketName : chr "VIX"
$ tradingClass : chr "VIX"
$ conId : chr "13455763"
$ minTick : chr "0.01"
$ orderTypes : chr [1:22] "ACTIVETIM" "ADJUST" "ALERT" "ALLOC" ...
$ validExchanges: chr "CBOE"
$ priceMagnifier: chr "1"
$ underConId : chr "0"
$ longName : chr "CBOE Volatility Index"
> con
List of 14
$ conId : chr "13455763"
$ symbol : chr "VIX"
$ sectype : chr "IND"
$ exch : chr "CBOE"
$ primary : chr ""
$ expiry : chr ""
$ strike : chr "0.0"
$ currency : chr ""
$ right : chr ""
$ local : chr ""
$ multiplier : chr ""
$ combo_legs_desc: NULL
$ comboleg : NULL
$ include_expired: chr "0"
> dput(con)
structure(list(conId = "13455763", symbol = "VIX", sectype = "IND",
exch = "CBOE", primary = "", expiry = "", strike = "0.0",
currency = "USD", right = "", local = "", multiplier = "",
combo_legs_desc = NULL, comboleg = NULL, include_expired = "0"),
.Names = c("conId",
"symbol", "sectype", "exch", "primary", "expiry", "strike", "currency",
"right", "local", "multiplier", "combo_legs_desc", "comboleg",
"include_expired"), class = "twsContract")
HTH
Jeff
On Fri, Sep 3, 2010 at 11:15 AM, Jonathan Shore
<jonathan.shore at gmail.com> wrote:
> Hi,
>
> I'm trying to load a few years worth of VIX data from IB. I am able to see in the TWS UI, but fail to load in R. I suspect that I am not specifying the contract properly, but TWS documentation (not the R IBrokers package) is extremely poor.
>
> As there is no twsIndex() function to create a contract for an index, so have tried a few variations of the following:
>
> tws <- twsConnect()
> Cvix <- twsContract (tws, "VIX","IND","CBOE", primary="", expiry="", strike = "0.0",
> currency = "USD", right = "", local = "", multiplier="", NULL, NULL, include_expired="0")
>
> Requesting historical data with the above contract:
>
> reqHistoricalData(tws, Cvix)
>
> hangs indefinitely. I'm guessing that TWS does not like the contract ...
>
> Can someone point me to the proper way of specifying the contract.
>
> Thanks!
>
> Jonathan
>
>
> [[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.
>
--
Jeffrey Ryan
jeff.a.ryan at gmail.com
More information about the R-SIG-Finance
mailing list