alpacahq / alpaca-backtrader-api

Alpaca Trading API integrated with backtrader
https://pypi.org/project/alpaca-backtrader-api/
Apache License 2.0
613 stars 144 forks source link

Multiple datas sample no longer works #495

Open benlevitas opened 2 years ago

benlevitas commented 2 years ago

I am using python3.7 with the following dependencies:

aiohttp==3.7.4
alpaca-backtrader-api==0.15.0
alpaca-trade-api==1.4.3
async-timeout==3.0.1
attrs==21.4.0
backtrader==1.9.76.123
certifi==2022.6.15
chardet==3.0.4
charset-normalizer==2.1.0
cycler==0.11.0
exchange-calendars==3.4
idna==3.3
kiwisolver==1.4.3
korean-lunar-calendar==0.2.1
matplotlib==2.2.5
msgpack==1.0.2
multidict==6.0.2
numpy==1.21.2
pandas==1.3.2
pandas-market-calendars==3.4
pyluach==2.0.0
pyparsing==3.0.9
python-dateutil==2.8.2
pytz==2022.1
PyYAML==5.4.1
requests==2.28.1
six==1.16.0
toolz==0.12.0
tqdm==4.64.0
typing_extensions==4.3.0
urllib3==1.26.10
websocket-client==1.3.3
websockets==9.1
yarl==1.7.2

When running the example I get the following error in a loop:

2022-07-12 11:03:39,871 connected to: wss://stream.data.alpaca.markets/v2/iex
2022-07-12 11:03:39,872 connected to: wss://paper-api.alpaca.markets/stream/
2022-07-12 11:03:39,895 error during websocket communication: connection limit exceeded
Traceback (most recent call last):
  File "***venv/lib/python3.7/site-packages/alpaca_trade_api/stream.py", line 235, in _run_forever
    await self._start_ws()
  File "***venv/lib/python3.7/site-packages/alpaca_trade_api/stream.py", line 89, in _start_ws
    await self._auth()
  File "***venv/lib/python3.7/site-packages/alpaca_trade_api/stream.py", line 83, in _auth
    raise ValueError(msg[0].get('msg', 'auth failed'))
ValueError: connection limit exceeded
holicst commented 1 year ago

I am using python3.7 with the following dependencies:

aiohttp==3.7.4
alpaca-backtrader-api==0.15.0
alpaca-trade-api==1.4.3
async-timeout==3.0.1
attrs==21.4.0
backtrader==1.9.76.123
certifi==2022.6.15
chardet==3.0.4
charset-normalizer==2.1.0
cycler==0.11.0
exchange-calendars==3.4
idna==3.3
kiwisolver==1.4.3
korean-lunar-calendar==0.2.1
matplotlib==2.2.5
msgpack==1.0.2
multidict==6.0.2
numpy==1.21.2
pandas==1.3.2
pandas-market-calendars==3.4
pyluach==2.0.0
pyparsing==3.0.9
python-dateutil==2.8.2
pytz==2022.1
PyYAML==5.4.1
requests==2.28.1
six==1.16.0
toolz==0.12.0
tqdm==4.64.0
typing_extensions==4.3.0
urllib3==1.26.10
websocket-client==1.3.3
websockets==9.1
yarl==1.7.2

When running the example I get the following error in a loop:

2022-07-12 11:03:39,871 connected to: wss://stream.data.alpaca.markets/v2/iex
2022-07-12 11:03:39,872 connected to: wss://paper-api.alpaca.markets/stream/
2022-07-12 11:03:39,895 error during websocket communication: connection limit exceeded
Traceback (most recent call last):
  File "***venv/lib/python3.7/site-packages/alpaca_trade_api/stream.py", line 235, in _run_forever
    await self._start_ws()
  File "***venv/lib/python3.7/site-packages/alpaca_trade_api/stream.py", line 89, in _start_ws
    await self._auth()
  File "***venv/lib/python3.7/site-packages/alpaca_trade_api/stream.py", line 83, in _auth
    raise ValueError(msg[0].get('msg', 'auth failed'))
ValueError: connection limit exceeded

Hi,

Have you found a solution for this? I have the same issue...