I've been trying out scripts to get a feel of using the API, and in the process of changing the client ID I now have several connections through port 7497.
How can I disconnect from them? Either one at a time or all at once?
Here is what I've tried without success:
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
class IBapi(EWrapper, EClient):
def __init__(self):
EWrapper.__init__(self)
EClient.__init__(self,self)
app = IBapi()
#app.connect('127.0.0.1', 7497, 103)
app.disconnect()
app.run()
I would've thought I could put the client_id into app.disconnect() but it throws an error.
I've enabled/disabled the "ActiveX and Sockets" setting in TWS but it seems like a crude method to use.
Do you usually put app.disconnect() at the end of every function?
How can I disconnect from them? Either one at a time or all at once?
Here is what I've tried without success:
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
class IBapi(EWrapper, EClient):
def __init__(self):
EWrapper.__init__(self)
EClient.__init__(self,self)
app = IBapi()
#app.connect('127.0.0.1', 7497, 103)
app.disconnect()
app.run()
I would've thought I could put the client_id into app.disconnect() but it throws an error.
I've enabled/disabled the "ActiveX and Sockets" setting in TWS but it seems like a crude method to use.
Do you usually put app.disconnect() at the end of every function?