When I try to use the 'ibtws' class in MATLAB R2013b to access data from the Interactive Brokers (IB) Trader Workstation , for instance if I am trying to run the example function 'reqMktDataEx', I get the following error:
No method 'reqMktDataEx' with matching signature found for class 'COM.TWS_TwsCtrl_1'.
My code is as follows, how can I fix this?
ib = ibtws('',7496);eventNames = {'errMsg','tickSize','tickString','tickPrice'};for i = 1:length(eventNames) registerevent(ib.Handle,{eventNames{i},... @(varargin)ibExampleRealtimeEventHandler(varargin{:})})endf = findobj('Tag','IBStreamingDataWorkflow');if isempty(f) f = figure('Tag','IBStreamingDataWorkflow','MenuBar','none',... 'NumberTitle','off'); pos = get(f,'Position'); set(f,'Position',[pos(1) pos(2) pos(3)+37 109]) colnames = {'Trade' 'Size' 'Bid' 'BidSize' 'Ask' 'AskSize' ... 'Total Volume'}; rownames = {'AAA','BBB','DDDD'}; data = cell(3,6); uitable(f,'Data',data,'RowName',rownames,'ColumnName',colnames,... 'Position',[10 30 582 76],'Tag','SecurityDataTable'); uicontrol('Style','text','Position',[10 5 497 20],'Tag','IBMessage'); uicontrol('Style','pushbutton','String','Close',... 'Callback',... 'evalin(''base'',''close(ib);close(findobj(''''Tag'''',''''IBStreamingDataWorkflow''''));'')',... 'Position',[512 5 80 20]);endibContract = ib.Handle.createContract;ibContract.symbol = 'IBM';ibContract.secType = 'STK';ibContract.exchange = 'SMART';ibContract.currency = 'USD';reqMktDataEx(ib.Handle,1,ibContract,'100',0);
Best Answer