IB-Matlab Streaming Data
显示 更早的评论
Hi together,
I am struggling with getting live market data to stream to Matlab from IB API. I request the live data stream based on the IB-Matlab user guide, and then request data from the struct using 'quotesnumber',-1. What I do not understand is when I request data again from the stream, I get the original request and time stamp. Here is the code I am using:
reqId = IBMatlab('action','query', 'localsymbol','XYZ', 'currency','EUR', 'sectype','STK', 'exchange','SMART', 'QuotesNumber',1000);
start(timer('period',0.25, 'executionMode','fixedRate', 'timerFcn',@myCallback)) % start a 0.25-secs timer
function myCallback(hTimer,eventdata) latestDataStruct = IBMatlab('action','query', 'localsymbol','XYZ', 'QuotesNumber',-1);
bid = latestDataStruct.data.bidPrice;
ask= latestDataStruct.data.askPrice; end
Every sequential time I get the old data from the original request. What I‘m doing wrong? Please help me out.
Kind regards and thank you in advance
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Equity Derivatives 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!