[R-SIG-Finance] reqMktDepth
Stephen Choularton
stephen at organicfoodmarkets.com.au
Mon Dec 13 20:29:24 CET 2010
I'm trying to use market depth information but falling at the first fence.
This code:
library(IBroker)
tws <- twsConnect(9)
tws
#reqMktDepth(tws, list(twsEquity("CBA","ASX","AUD")))
#reqMktData(con, list(twsEquity("CBA","ASX","AUD")))
# write to a file
#reqMktDepth(tws, twsEquity("CBA","ASX","AUD"), file='c:/rMktDepth/out.dat')
reqMktDepth(tws, twsEquity("GOOG"))
#reqMktDepth(tws, twsEquity("GOOG"), file='c:/rMktDepth/out.dat')
closeAllConnections()
Produces:
> > tws <- twsConnect(9)
> tws
<twsConnection,9 @ 20101214 06:18:55 Eastern Standard Time (New South
Wales), nextId=1>
>
> #reqMktDepth(tws, list(twsEquity("CBA","ASX","AUD")))
>
>
> #reqMktData(con, list(twsEquity("CBA","ASX","AUD")))
>
>
> # write to a file
> #reqMktDepth(tws, twsEquity("CBA","ASX","AUD"),
file='c:/rMktDepth/out.dat')
>
>reqMktDepth(tws, twsEquity("GOOG"))
> # reqMktDepth(tws, twsEquity("GOOG"), file='c:/rMktDepth/out.dat')
TWS Message: 2 -1 2104 Market data farm connection is OK:aufarm
TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm
[hanging so hit Esc]
>
> closeAllConnections()
>
>
Can anyone see what I'm doing wrong?
--
Stephen Choularton Ph.D., FIoD
More information about the R-SIG-Finance
mailing list