softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
61 stars 21 forks source link

reqMktData "warning(['could not process event: ',class(e)]) " with Stocks only #150

Open Fry92 opened 2 years ago

Fry92 commented 2 years ago

@softwarespartan

Hi Abel,

Thanks for this great API ! I am quite new but I already got pretty familiar with it.

Still I have an issue I can't solve for quite some time. When using reqMktData with stocks (IVV for example). I receive the generic data tick but sometimes I get this error:

com.mathworks.jmi.MatlabException: Unrecognized function or variable 'e'. at com.mathworks.jmi.NativeMatlab.SendMatlabMessage(Native Method) at com.mathworks.jmi.NativeMatlab.sendMatlabMessage(NativeMatlab.java:273) at com.mathworks.jmi.MatlabLooper.sendMatlabMessage(MatlabLooper.java:120) at com.mathworks.jmi.Matlab.mtFevalConsoleOutput(Matlab.java:1835) at com.proxy.ProxyBuilder$Handler$2.run(ProxyBuilder.java:128) Unrecognized function or variable 'e'.

Error in TWS.processNotification (line 269) warning(['could not process event: ',class(e)])

Note that it doesn't happen with currency or CFD.

I understand that IB sends a signal that doesn't match any classe in the TWS.processNotification function, thus the last line of the error

I read on : https://groups.io/g/twsapi/topic/4045030 this sentence that I believe is linked to that problem: "Split up of the MktData into MktDataSTK, MktDataFUT etc. The work-around for the "zero size bug" of Mike Smith does fit in this layer nicely." looks like this Mike Smith got this same error into his own program. Btw this topic is 12 years old...

So do you think this error I get comes from this "zero size bug" or from something else ? If it is so, maybe I can skip this error or try to hide it. Otherwise can I change the class somehow to handle this information ?

I am using the v9.73 API and TWS Build 10.16.1f and IB Gateway 981.

Thanks again for your work and all the other active members. I find lots of precious information here ;-)

Despair2000 commented 2 years ago

I had a look and I think it is a typo in the TWS.processNotification.m. I think there it should say class(event) and not class(e). This should fix the error but the case that you get this error shows that there is triggered an event that is not implemented in IB4m. After you corrected the mentioned typo you should get a correct error message which also shows the event that triggered the error. This would be interesting.