[R-SIG-Finance] reqMktDepth

Jeff Ryan jeff.a.ryan at gmail.com
Mon Dec 13 21:24:12 CET 2010


I think the IB API has changed, I will look into it and get a patch out.

Thanks for the report.

Best,
Jeff

On Mon, Dec 13, 2010 at 1:29 PM, Stephen Choularton
<stephen at organicfoodmarkets.com.au> wrote:
> 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
>
> _______________________________________________
> 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.
>



-- 
Jeffrey Ryan
jeffrey.ryan at lemnica.com

www.lemnica.com



More information about the R-SIG-Finance mailing list