Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session.eClientSocket.reqPositions() causes java.lang.NullPointerException #15

Closed
dani-alvez opened this issue Nov 24, 2017 · 8 comments

Comments

@dani-alvez
Copy link

thanks for sharing your code, looks very useful!
when I run session.eClientSocket.reqPositions() to get open positions without having done any trade, I get a java.lang.NullPointerException and the connection to TWS will be closed.
When I have an open position or previously had them, then there won't be any error. Also when I restart TWS or Matlab, still there will be no error. It looks like after the night when the daily trades had been cleared, the error appears again.
Can you reproduce this? Is there any fix for that? Thanks for your help.
BTW, I'm running your latest version of IB4m, Matlab 2017a and TWS 962.2c with API 9.71.

@softwarespartan
Copy link
Owner

softwarespartan commented Nov 25, 2017 via email

@softwarespartan
Copy link
Owner

softwarespartan commented Nov 25, 2017 via email

@dani-alvez
Copy link
Author

dani-alvez commented Nov 25, 2017

dear Abel,
thanks for your quick reply!
yes, it seems to happen only when in TWS the activity window is empty, i.e. after old trades have been deleted from there over night.
I just installed the latest stable version (968.2g) and the same error happens.

>> TWSSession.eClientSocket.reqPositions();
java.lang.NullPointerException

java.lang.NullPointerException

connection closed ...

thanks, dan

@dani-alvez
Copy link
Author

dear Abel,
any news on this issue?
thanks
dan

@softwarespartan
Copy link
Owner

softwarespartan commented Dec 15, 2017 via email

@softwarespartan
Copy link
Owner

softwarespartan commented Dec 17, 2017 via email

@softwarespartan
Copy link
Owner

softwarespartan commented Dec 21, 2017 via email

@dani-alvez
Copy link
Author

Dear Abel,
thanks for the fix!
enjoy holidays,
dan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants