[R-SIG-Finance] ibrokers - problems retrieving Indices/ETFs
Matti Zemack
matti.zemack at gmail.com
Thu Mar 21 18:31:01 CET 2013
Dear geniuses,
Thanks ALL for all suggestions.
The below from Enrico worked perfectly well to retrieve indices;
library(IBrokers)
tws <- twsConnect()
spx.csv <- file("SPX.csv", open="w")
reqMktData(tws, twsContract(local = "SPX", sectype = "IND", exch = "CBOE", currency = "USD", include_expired = 1, conId = "", symbol = "", primary = "", expiry = "", strike = "", right = "", multiplier = "", combo_legs_desc = "", comboleg = "", secIdType = "", secId = ""), eventWrapper=eWrapper.MktData.CSV(1), file=spx.csv)
close(spx.csv)
close(tws)
Thanks also Aliona for the suggestion of using SMART instead of CBOE. Will try it for other iBrokers uses shortly, save me from looking up all the markets...
Love this community, also open for newbies. :-)
Rgds,
Matti Zemack,
Stockholm, Sweden
On Mar 20, 2013, at 8:10 AM, Enrico Schumann <es at enricoschumann.net> wrote:
>
> myCon <- twsContract(local = "SPX", sectype = "IND",
> exch = "CBOE", currency = "USD",
> include_expired = 1,
> conId = "", symbol = "", primary = "", expiry = "",
> strike = "", right = "", multiplier = "",
> combo_legs_desc = "",
> comboleg = "", secIdType = "", secId = "")
>
More information about the R-SIG-Finance
mailing list