alpacahq / alpaca-trade-api-js

Node.js library for Alpaca Trade API.
https://www.npmjs.com/package/@alpacahq/alpaca-trade-api
Apache License 2.0
515 stars 134 forks source link

[Question]: Unable to find method for test stream wss://stream.data.alpaca.markets/v2/test (FAKEPACA) #272

Closed KrugST closed 6 days ago

KrugST commented 1 week ago

Question form pre-submit checklist.

Question

API documentation says there is test stream we can use off-market hours to test our code:

Test stream
We provide a test stream that is available all the time, even outside market hours, on this URL:
wss://stream.data.alpaca.markets/v2/test
Use the symbol "FAKEPACA" when trying out this test stream.

But I don't see a separate method for this. I also tried subscribing to FAKEPACA on data_stream_v2 but there is no updates there. const websocket = alpaca.data_stream_v2; websocket.onConnect(() => { websocket.subscribeForBars(["FAKEPACA"]); }); I did implement my own WS connection with that end-point and FAKEPACA subscription, it sends msgs every minute, off-market hours.

KrugST commented 6 days ago

Found a better way to test my ws.