I am trying to develop using Alpaca Market Data websocket. When I try to authorize using my paper keys, I got a response WaitingForActivation. The keys are used actively in an app already, and works.
This is my first time using websocket, so I might have missed something.
Shlomik
September 3, 2020, 12:37pm
2
Hi,
you could use this as a template of using the streaming api:
from alpaca_trade_api import StreamConn
from alpaca_trade_api.common import URL
ALPACA_API_KEY = "<YOUR-API-KEY>"
ALPACA_SECRET_KEY = "<YOUR-SECRET-KEY>"
USE_POLYGON = False
if __name__ == '__main__':
import logging
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
conn = StreamConn(
ALPACA_API_KEY,
ALPACA_SECRET_KEY,
base_url=URL('https://paper-api.alpaca.markets'),
data_url=URL('https://data.alpaca.markets'),
# data_url=URL('ws://127.0.0.1:8765'),
data_stream='polygon' if USE_POLYGON else 'alpacadatav1'
This file has been truncated. show original
I am using VB.NET at the moment. You have a C# library, I might start using it.
Do you have any feedback on the websocket implemented there?
Shlomik
September 3, 2020, 3:48pm
4
it should work the same way as the python websocket