AutoTrader
AutoTrader copied to clipboard
Peer closed connection. clientId 3 already in use?
Hello, I tried to use feed='ib' for testing macd strategy example provided and every time I try to connect to TWS this happens:
runfile.py
from autotrader import AutoTrader
# Create AutoTrader instance, configure it, and run backtest
at = AutoTrader()
keys_config = {
"IB": {
"host": "127.0.0.1",
"clientID": 7497,
"clientID": 0
}
}
at.configure(global_config=keys_config, verbosity=1, show_plot=True, feed='ib')
at.add_strategy('macd')
at.backtest(start='1/1/2021', end='1/5/2022')
at.virtual_account_config(initial_balance=1000, leverage=30)
at.run()
output: Peer closed connection. clientId 3 already in use? API connection failed: TimeoutError()