realtime with Interactive Brokers

3 次查看(过去 30 天)
I am curious if there is a way to directly set the data that the function 'realtime' outputs to a variable. The way it is shown the the Matlab help file, http://www.mathworks.com/help/trading/ibtws.realtime.html, whatever variable you assign to 'realtime' gets set to the ID number, and then it creates a variable called ibBuiltInRealtimeData. Once ibBuiltInRealtimeData loads, then I can set it equal to a variable, but it would be preferable to not have to wait for the variable to load in the workspace since this is inside a loop to get data for thousands of different contracts.
I know that 'getdata' does essentially what I am trying to do, but it rarely works for me.
Thanks in advance for any help,
Nick

回答(1 个)

Scott Meier
Scott Meier 2018-11-9
I have done this exactly. I open a new,unique connection for just the 'realtime' communications. I call the 'realtime' function and then assign each element of the 'realtime' response to a unique variable. I still use a loop to update the variables, but I no longer need to repeatedly use the 'getdata' function.

类别

Help CenterFile Exchange 中查找有关 Transaction Cost Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by