You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR -1 502 Couldn't connect to TWS. Confirm that "Enable ActiveX and Socket EClients"
is enabled and connection port is the same as "Socket Port" on the
TWS "Edit->Global Configuration...->API->Settings" menu. Live Trading ports:
TWS: 7496; IB Gateway: 4001. Simulated Trading ports for new installations
of version 954.1 or newer: TWS: 7497; IB Gateway: 4002
using this code:
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
class IBapi(EWrapper, EClient):
def __init__(self):
EClient.__init__(self, self)
app = IBapi()
app.connect('127.0.0.1', 4002,123)
app.run()
tried all 4 ports with no luck...
The text was updated successfully, but these errors were encountered:
Make sure you have "Enable ActiveX and Socket EClients" enabled in your settings. If you download and use VNCviewer you should be able to inspect the application and go to settings and see if both "Enable ActiveX and Socket EClients" are enabled.
tried all 4 ports with no luck...
The text was updated successfully, but these errors were encountered: