-
Notifications
You must be signed in to change notification settings - Fork 21
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
Unable to connect to TWS #31
Comments
Thanks for reaching out.
Can you provide additional details ...
Port number in TWS api configuration vs port number specified in the connection call is often mismatch. Please confirm match
What is OS?
What ver of matlab?
Do you have trading toolbox installed?
…Sent from my iPhone
On Jul 9, 2018, at 5:36 AM, Jdo503 ***@***.***> wrote:
Hi,
I am trying to connect to TWS and run the Account Summary but I get the following error….
**-1 502 Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu.
-1 504 Not connected**
I have followed all the instructions + Enabled ActiveX and Socket Clients on TWS.....
Any ideas please?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
were you able to resolve connection issue? |
Hi, Sorry I have been on holiday. Yes I have been able to resolve it - It was a port number issue..... Thanks, J |
Sorry for resurrecting this thread. I have updated to your 9.73 version and try to make it work. One thing that feels strange and you are maybe not aware of is the following problem: |
hm … yes indeed, I would want to know :) Thanks for the heads up.
This could be an issue with internal thread that has to get started when connecting to TWS. This was a poor design decision from IB but not much we can do about it.
If TWS closes then the socket gets interrupted so the thread might get clobbered. I can double check.
Can you try “clear all” on the matlab side? This should eject the current eclient.Reader and force JVM to make a new one when TWS.Session is created.
…-abel
On Aug 29, 2018, at 4:47 AM, Despair2000 ***@***.***> wrote:
Sorry for resurrecting this thread.
I have updated to your 9.73 version and try to make it work. One thing that feels strange and you are maybe not aware of is the following problem:
When I start the gateway and afterwards matlab, it works fine but if I then exit the gateway and restart it I receive the same error message like Jdo503. I have to close matlab and restart this also to make it work again. No big deal but I thought you might want to know.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#31 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWq1PhLV4gBIcYdncqVF8QqYlzisCgvks5uVlU_gaJpZM4VHoLJ>.
|
You were right. "clear all" removes the notification listener and afterwards it works fine to reconnect. (BTW I send you another email yesterday regarding a problem I experience. Would be grateful about a comment. Thanks in advance! - I can also describe the problem here on GitHub if you prefer?) |
Hi, I am also facing a similar issue where I get the error "Error 1 504 Not connected" from ibapi.client import EClient class TestApp(EWrapper,EClient): def main():
if name == "main": and I have checked Enabled ActiveX and Socket Clients on TWS and have confirmed that the port is also correct. Any help will be appreciated. Thanks |
Thanks for reaching out. This repository is for IB4m. If you have IB4m related question, happy to help. You might post your question on Stackoverflow or similar for IB support. |
I have the same problem ERROR -1 502 Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket EClients" |
@csselo please confirm the port number specified in the eClient.connect call matches the port number configured in TWS. Probably 9.9 out of 10 times, just need to specify/align the correct ports. |
Hi, I also got the same error 502. My port number in TWS and eClient.connect call are matched.. Is there any other solution to solve this problem? I tried port numbers: 7496, 7497, 4002, 4001 ...still failed to connect. Note: Tried turning-off firewall, enabled Active X....etc. still not working. |
Thanks for reaching out
Can you share the output on the command window and the command you’re running
Also do you have trading toolbox installed?
… On May 12, 2020, at 11:17 AM, harrodschui ***@***.***> wrote:
Hi, I also got the same error 502.
My port number in TWS and eClient.connect call are matched.. Is there any other solution to solve this problem?
I tried port numbers: 7496, 7497, 4002, 4001 ...still failed to connect.
Note: Tried turning-off firewall, enabled Active X....etc. still not working.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi @softwarespartan , here is my command and output: Command:: class TestApp(EWrapper, EClient):
def main():
if name == "main":
|
Your code does not look like IB4m matlab code :) Looks like you're using Interactive Brokers Python API. |
Hi,
I am trying to connect to TWS and run the Account Summary but I get the following error….
**-1 502 Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu.
-1 504 Not connected**
I have followed all the instructions + Enabled ActiveX and Socket Clients on TWS.....
Any ideas please?
The text was updated successfully, but these errors were encountered: