[R-SIG-Finance] IBrokers question

Robert Schien robsch at robsch.eu
Mon Dec 1 15:51:50 CET 2014


Hello,

I have some questions concerning the IBrokers package.

I want to sample some tick data into a data frame or time series.

What I do is the following:

library(IBrokers)
iws <- ibgConnect()
equity <- twsEquity("GS")
reqMktData(tws,equity)

Now my questions is: How can I access the individual data
like tickprice, ask, bid etc?

I know that I can create an eWrapper structure and modify
the individual functions.

mywrapper <- eWrapper()
mywrapper$tickPrice <- function(msg, timestamp, file, ...) {cat("tickPrice",msg)}              
reqMktData(tws,equity,eventWrapper=mywrapper)

But where are the interesting market data hidden and how can I access them?
This has probably to do with the .data environment and the get.data
method. But how does it work exactly?
The vignette is not quite clear to me.


Thank you in advance.

Greetings
Robert



More information about the R-SIG-Finance mailing list