-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
In this case I am subscribing to 'alpacadatav1/AM.TSLA' and then 'alpacadatav1/AM.SPY.
Appereantly you await conn.unsubscribe(previous_channels) when adding additional subscriptions and then re-subscribe.
This process doesnt work and fails in the trade api part, because the self._ws part is None
2021-02-01 01:27:10,493 root Alpaca Proxy Agent v0.5.5
2021-02-01 01:27:10,493 root Using the Alpaca Websocket
< {'action': 'authenticate', 'data': {'key_id': 'PKMIAA7DFADUGOKNIGUR', 'secret_key': '98xk2nDUq6QswX9fAuN3Mj4ZLLUI7ptFrVCzTCtc'}}
< {'action': 'listen', 'data': {'streams': ['alpacadatav1/AM.TSLA']}}
previous channels []
new_channels ['alpacadatav1/AM.TSLA']
< {'action': 'authenticate', 'data': {'key_id': 'PKMIAA7DFADUGOKNIGUR', 'secret_key': '98xk2nDUq6QswX9fAuN3Mj4ZLLUI7ptFrVCzTCtc'}}
< {'action': 'listen', 'data': {'streams': ['alpacadatav1/AM.SPY']}}
previous channels ['alpacadatav1/AM.TSLA']
new_channels ['alpacadatav1/AM.SPY']
Traceback (most recent call last):
File "main.py", line 169, in serve
await conn.unsubscribe(previous_channels)
File "/usr/local/lib/python3.6/site-packages/alpaca_trade_api/stream2.py", line 278, in unsubscribe
await self.data_ws.unsubscribe(data_channels)
File "/usr/local/lib/python3.6/site-packages/alpaca_trade_api/stream2.py", line 121, in unsubscribe
await self._ws.send(json.dumps({
AttributeError: 'NoneType' object has no attribute 'send'
Done
2021-02-01 01:28:18,987 root connected to: wss://data.alpaca.markets/stream
Metadata
Metadata
Assignees
Labels
No labels