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

Couldn't Connect to TWS #27

Closed
trippingCub opened this issue May 27, 2018 · 6 comments
Closed

Couldn't Connect to TWS #27

trippingCub opened this issue May 27, 2018 · 6 comments

Comments

@trippingCub
Copy link

I'm stuck at the very start, with Matlab R2017b showing this error:

-1 502 Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu.

I did everything mentioned in quick start, my matlab commant statements are:

cd 'softwarespartan-IB4m-15bb4fd';
addpath(path,pwd);
addpath(path,fullfile(pwd,'docs'))
javaaddpath(fullfile(pwd,'Jar','TWS.jar'))

AccountSummaryExample

I have navigated to IBM4 folder. And I configured TWS as required.

image

Can you please point what I'm doing wrong here?
Appreciate your support.

@softwarespartan
Copy link
Owner

softwarespartan commented May 27, 2018 via email

@trippingCub
Copy link
Author

Abel,

Thanks for your fast response. I found this is AccountSummaryExample file:

% establish connection with TWS
session.eClientSocket.eConnect('127.0.0.1',7496,0);

The port numbers are different. Which one should I change? The one in the code?

@trippingCub
Copy link
Author

I changed the port number in the AccountSummaryExample file, it was a succes but then showed this error:

Error using AccountSummaryExample (line 56)
Java exception occurred:
org.apache.commons.collections.BufferUnderflowException: The buffer is already empty

at org.apache.commons.collections.buffer.BoundedFifoBuffer.get(BoundedFifoBuffer.java:260)

@softwarespartan
Copy link
Owner

softwarespartan commented May 27, 2018 via email

@trippingCub
Copy link
Author

Thank you, everything works as it should now!

@softwarespartan
Copy link
Owner

softwarespartan commented May 28, 2018 via email

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