'How do I stream data from two different web sockets at the same time using the websocket.WebsocketApp in python?
I am using the Alpca api to create a stock trading algorithm with Python. I can stream quote and minute bar data through the web socket using:
socket = "wss://data.alpaca.markets/stream"
ws = websocket.WebSocketApp(socket, on_open=on_open, on_message=on_message,
on_close=on_close)
ws.run_forever()
However, I need to stream trade_update data at the same time from a different socket :
socket = "wss://paper-api.alpaca.markets/stream "
How do I stream data from two different web sockets at the same time using the format above in python?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
