kieran-mackle / AutoTrader

A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.

Home Page:https://kieran-mackle.github.io/AutoTrader/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Peer closed connection. clientId 3 already in use?

kinkocho opened this issue · comments

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()