alpaca-trade-api-js
alpaca-trade-api-js copied to clipboard
Unable to stream order updates from websockets v2 (AlpacaStreamV2Client)
The documentation here seems to indicate that you can receive order/trade updates via websockets, however it doesn't look like the current websockets v2 client supports those events.
Am I missing something or is that supported in this library yet? Any plans to implement that?
I also received a problem, importing alpaca doesn't import data_stream_v2. Upon using the following code. Although it does import data_ws which is v1.
const socket = alpaca.data_stream_v2
socket.onConnect(function () {
console.log("Connected");
socket.subscribeForQuotes(["AAPL"]);
socket.subscribeForTrades(["FB"]);
socket.subscribeForBars(["SPY"]);
});`
Type error: Cannort read property onConnect of undefined
I was testing the alpaca-trade-api-js and it seems that the example in "examples/websocket_example_datav2.js" doesn't work.
Hello @thomas07vt , the data v2 websocket only supports trades
, quotes
, bars
, dailyBars
, tradingStatuses
and lulds
.
Hello @hudsonbl , @AminSarafraz . This example works for me, could you please give more detail about your issues if you still experiences some?