-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple_data_strategy.py throwing exception: your connection is rejected #55
Comments
Hi, so working with multiple data is currently an issue. |
Yeah, the Alpaca API mentioned that they don't support multiple websocket connections, so this looks like a good workaround. I'll try it out, thanks. |
Are you guys talking about running it on multiple tickers? |
yes |
Thanks, this got backtesting up and running. |
Hey there,
I'm encountering this issue while running the unmodified multiple_data_strategy.py sample in paper trading mode. I have no other scripts running on the account. This is the exception:
Starting Portfolio Value: 100000.0
Exception in thread Thread-7:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/alpaca_backtrader_api/alpacastore.py", line 483, in _t_streaming_prices
streamer.run()
File "/home/pi/.local/lib/python3.7/site-packages/alpaca_backtrader_api/alpacastore.py", line 132, in run
self.conn.run(channels)
File "/home/pi/.local/lib/python3.7/site-packages/alpaca_trade_api/stream2.py", line 275, in run
loop.run_until_complete(self.subscribe(initial_channels))
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/.local/lib/python3.7/site-packages/alpaca_trade_api/stream2.py", line 250, in subscribe
await self.data_ws.subscribe(data_channels)
File "/home/pi/.local/lib/python3.7/site-packages/alpaca_trade_api/stream2.py", line 104, in subscribe
await self._ensure_ws()
File "/home/pi/.local/lib/python3.7/site-packages/alpaca_trade_api/stream2.py", line 88, in _ensure_ws
await self._connect()
File "/home/pi/.local/lib/python3.7/site-packages/alpaca_trade_api/stream2.py", line 52, in _connect
raise Exception(f"Error while connecting to {self._endpoint}:"
Exception: Error while connecting to wss://data.alpaca.markets/stream:your connection is rejected while another connection is open under the same account
The text was updated successfully, but these errors were encountered: