Closed JeffStodd closed 4 months ago
@JeffStodd Thank you for the feedback. Could you please try to use FAKEPACA
instead of SPY
for the test stream?
https://docs.alpaca.markets/docs/streaming-market-data#subscription
For example in the test stream, you can send this message: {"action":"subscribe","trades":["FAKEPACA"]}
@JeffStodd Thank you for the feedback. Could you please try to use
FAKEPACA
instead ofSPY
for the test stream?https://docs.alpaca.markets/docs/streaming-market-data#subscription
For example in the test stream, you can send this message: {"action":"subscribe","trades":["FAKEPACA"]}
Thanks, that seems to work. By the way, is there a test websocket for paper trading?
By the way, is there a test websocket for paper trading?
Yeah, in my understanding, you can use credentials (API key/secret) of a paper account.
By the way, is there a test websocket for paper trading?
Yeah, in my understanding, you can use credentials (API key/secret) of a paper account.
Do you know why I am getting authentication errors? I verified my keys are correct (I am able to get account data with TradingClient) but it doesn't seem to connect to the sandbox websocket with paper account creds. Using exact same code but setting env vars differently: wss://stream.data.sandbox.alpaca.markets/v2/test or wss://stream.data.sandbox.alpaca.markets/v2/iex paper api key paper secret key
INFO:alpaca.data.live.websocket:started data stream
INFO:alpaca.data.live.websocket:starting data websocket connection
INFO:alpaca.data.live.websocket:connecting to wss://stream.data.sandbox.alpaca.markets/v2/test
DEBUG:websockets.client:= connection is CONNECTING
DEBUG:websockets.client:> GET /v2/test HTTP/1.1
DEBUG:websockets.client:> Host: stream.data.sandbox.alpaca.markets
DEBUG:websockets.client:> Upgrade: websocket
DEBUG:websockets.client:> Connection: Upgrade
DEBUG:websockets.client:> Sec-WebSocket-Version: 13
DEBUG:websockets.client:> Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
DEBUG:websockets.client:> Content-Type: application/msgpack
DEBUG:websockets.client:> User-Agent: APCA-PY/0.28.0
DEBUG:websockets.client:< HTTP/1.1 101 Switching Protocols
DEBUG:websockets.client:< Date: Wed, 10 Jul 2024 19:48:13 GMT
DEBUG:websockets.client:< Connection: upgrade
DEBUG:websockets.client:< Upgrade: websocket
DEBUG:websockets.client:< Strict-Transport-Security: max-age=31536000; includeSubDomains
DEBUG:websockets.client:= connection is OPEN
DEBUG:websockets.client:< BINARY 91 82 a1 54 a7 73 75 63 63 65 73 73 a3 6d 73 67 ... 6f 6e 6e 65 63 74 65 64 [26 bytes]
DEBUG:websockets.client:> BINARY 83 a6 61 63 74 69 6f 6e a4 61 75 74 68 a3 6b 65 ... 50 50 54 38 68 6d 42 42 [87 bytes]
DEBUG:websockets.client:< BINARY 91 83 a1 54 a5 65 72 72 6f 72 a4 63 6f 64 65 ce ... 68 20 66 61 69 6c 65 64 [36 bytes]
ERROR:alpaca.data.live.websocket:error during websocket communication: auth failed
Traceback (most recent call last):
File "c:\Python39\lib\site-packages\alpaca\data\live\websocket.py", line 342, in _run_forever
await self._start_ws()
File "c:\Python39\lib\site-packages\alpaca\data\live\websocket.py", line 134, in _start_ws
await self._auth()
File "c:\Python39\lib\site-packages\alpaca\data\live\websocket.py", line 125, in _auth
raise ValueError(msg[0].get("msg", "auth failed"))
ValueError: auth failed
@JeffStodd Sandbox env is for Broker API keys. For paper account API key/secrets, could you please try to put your paper API key/secret to StockDataStream with sandbox=False and url_override=None? you should put your paper API key/secret with paper=True and url_override=None for the TradingClient.
@JeffStodd Sandbox env is for Broker API keys. For paper account API key/secrets, could you please try to put your paper API key/secret to StockDataStream with sandbox=False and url_override=None? you should put your paper API key/secret with paper=True and url_override=None for the TradingClient.
Thanks, working now with those parameters
Is there an existing issue for this?
Current Behavior
From the docs:
However this was not returning anything when run at 7PM pacific:
Expected Behavior
No response
SDK Version I encountered this issue in
alpaca-py 0.28.0 Python 3.9.13
Steps To Reproduce
Filled out the Steps to Reproduce section?
Anything else?
No response