[R-SIG-Finance] how to get quotes with IBrokers

zerdna azege at yahoo.com
Wed Aug 18 06:20:14 CEST 2010

Hi, i need to get a quotes for a large set of stocks at 5 min after the open.
I am trying to use IBrokers, but frankly not making much progress. I
understand that i need to use reqMktData. It seems that taking snapshot is
what i need, but when i do something like 

df<-reqMktData(tws, lapply(nms, twsSTK), tickGenerics="", snapshot=T), 

where nms is my vector of tickers,

i get a dataframe back after waiting for a while -- about 12 sec per ticker,
which comes out to more than 1.5 hours for my list of 500 tickers. Also,
most of the data is NA. Maybe it has to do with stocks on the list being
relatively illiquid or maybe i am doing something wrong. Could someone
comment, please?

I looked into not using snapshot and try instead to use 
myWrapper <- eWrapper.MktData.CSV(1) and 
myWrapper$get.Data("data") . While i could do it for one stock by manually
interrupting reqMktData and getting last quote, i cannot figure out what
needs to be done for a list of stocks. Do i need to repeat reqMktData and
somehow programmatically interrupt inside the loop? Do i modify twsCALLBACK
to return after gathering full quote? Would really appreciate any pointers,
references, or help of any kind. 

View this message in context: http://r.789695.n4.nabble.com/how-to-get-quotes-with-IBrokers-tp2329328p2329328.html
Sent from the Rmetrics mailing list archive at Nabble.com.

More information about the R-SIG-Finance mailing list