I am not sure if this is a bug -- tried to reach Jeff Ryan through Nabble
message a while back, but it doesn't look like he got my message. So here
goes my question

In reqMktData in a couple of places expression
as.numeric(tickerId):length(Contract)) is used. In particular, it is used in 

    on.exit(cancelMktData(con,
as.character(as.numeric(tickerId):length(Contract))))

It seems to me this works fine when you call reqMktData once with default
tickerId="1". It then cancels all tickerIds in the range 1:length(Contract).
So far, so good. However, as tickerIds are not reusable in IB until you log
out from TWS, if you need to call reqMktData more than once, this code is
not going to cancel tickerId, as you will need to start with some other
tickerId, say tickerId=100. If i understand it correctly, there should be
something like
    tid<-as.numeric(tickerId)
    on.exit(cancelMktData(con, as.character(tid:(tid+length(Contract)))))

Maybe i am confused though, so any clarification would be appreciated
-- 
View this message in context: 
http://r.789695.n4.nabble.com/possible-bug-in-IBrokers-or-my-confusion-tp3035331p3035331.html
Sent from the Rmetrics mailing list archive at Nabble.com.

_______________________________________________
[email protected] 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.

Reply via email to