alpaca-trade-api-js icon indicating copy to clipboard operation
alpaca-trade-api-js copied to clipboard

Unable to stream order updates from websockets v2 (AlpacaStreamV2Client)

Open thomas07vt opened this issue 3 years ago • 4 comments

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?

thomas07vt avatar Apr 29 '21 02:04 thomas07vt

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

hudsonbl avatar Jun 08 '21 18:06 hudsonbl

I was testing the alpaca-trade-api-js and it seems that the example in "examples/websocket_example_datav2.js" doesn't work.

AminSarafraz avatar Aug 02 '21 03:08 AminSarafraz

Hello @thomas07vt , the data v2 websocket only supports trades, quotes, bars, dailyBars, tradingStatuses and lulds.

noramehesz avatar Oct 19 '21 13:10 noramehesz

Hello @hudsonbl , @AminSarafraz . This example works for me, could you please give more detail about your issues if you still experiences some?

noramehesz avatar Oct 19 '21 13:10 noramehesz