我有一个具有以下功能的 Matlab 对象:
function obj = request_historical(obj,ticktype)
startdate = floor(now)-1500;
enddate = floor(now);
period = '1 day';
tradehours = false;
eventhandler = 'IB_histHandler';
d2 = history(obj.ib,obj.ibContract,startdate,enddate,ticktype,period,...
tradehours,eventhandler);
end
然后我调用那个函数。该函数发送历史财务数据,并由另一个函数“IB_histhandler”处理。该函数与独立程序位于同一目录中。
使用工作区通过 Matlab 程序运行它时它工作正常,但每当我运行独立编译的程序时,我都会收到一堆警告:
Warning: Error occurred while evaluating listener callback.
> In pause (line 21)
In IB_socket (line 432)
In start (line 13)
In tradingbot (line 31)
Error using comeventcallback (line 24)
Error firing event 'historicalData' to 'IB_histHandler'.
就像我的独立 exe 程序找不到“IB_histhandler”函数,就像程序在使用工作区通过 MATLAB 运行时找到它一样。
有任何想法吗??