IBrokers reqMktData, how to add timeout to the callback function?
问题 I have been using a modified snapShot function from the great IBrokers package to get "Last" prices from IB and it has been working great for liquid stocks. The call I make is eg. reqMktData(tws, twsSTK("AAPL"), eventWrapper=eWrapper.data.Last(1),CALLBACK=snapShot) The problem arises when trying to retrieve very illiquid stocks or options. I would therefore need to add a timeout to the snapShot function. How and where could the timeout be added? The code with the snapShot function: library