[R-SIG-Finance] IBrokers question

cen six censix0 at gmail.com
Mon Dec 1 17:24:17 CET 2014


You could look at the code for

eWrapper.MktData.CSV


to see how to do something more useful with the datastream other than just
cat'ing it to output ...


mywrapper <- eWrapper()
mywrapper$tickPrice <- function(msg, timestamp, file, ...) {
cat("tickPrice",msg)
... do something useful, ie. store it somewhere, etc...
}
reqMktData(tws,equity,eventWrapper=mywrapper)

On Mon, Dec 1, 2014 at 3:51 PM, Robert Schien <robsch at robsch.eu> wrote:

>
> 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
>
> _______________________________________________
> 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.
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list