[R-SIG-Finance] Playback in IBrokers package

bshepherd at texxors.com bshepherd at texxors.com
Thu Dec 22 22:43:53 CET 2011


Hi all,

I'm having trouble getting the playback feature in the IBrokers  
package to work. I have saved the data with the following command:

reqMktData(twsDATA, Contract=contract, file =  
paste("C:/path/TWSFormat/ES2", Sys.Date(), ".txt", sep = ""),  
tickGenerics = "100,101,104,106,165,225")

It seems to have saved correctly; it produces a file with data like this:

<20111222 08:43:55.973232> id=1 symbol=ES bidPrice: 1241.25  bidSize: 54
<20111222 08:43:55.977233> id=1 symbol=ES askPrice: 1241.50  askSize: 206
<20111222 08:43:55.980233> id=1 symbol=ES lastPrice: 1241.25
<20111222 08:43:55.984234> id=1 symbol=ES bidSize: 54
<20111222 08:43:55.993235> id=1 symbol=ES askSize: 206
....

Then I try to play it back via:

> twsDATA <- twsConnect(filename = "C:/path/TWSFormat/ES22011-12-22.txt")
> twsDATA
<twsConnection, @ C:/path/TWSFormat/ES2011-12-22.txt, nextId=>
> contract <- twsFuture("ES","GLOBEX","201203")
> reqMktData(twsDATA, Contract=contract, tickGenerics =  
> "100,101,104,106,165,225", event=eWrapper.data(1))
Error in socketSelect(list(con), FALSE, 0.25) : not a socket connection

I'm not sure how to interpret (or fix) that error. Any help would be  
appreciated.

Thanks,
Bryan



More information about the R-SIG-Finance mailing list