Closed rrozenv closed 2 months ago
Hi, the trade_ws is for trades you make. I don't see any trades being made in this code sample.
general trade updates subscription is made like this: alpacadatav1/T.FB
(which you did). but you get the updates through the data_ws
Hi @shlomikushchi , thank you for the quick reply. My point is that I can't even connect to the web socket in order to get trade updates. I know no trades are being made in this example, but I am executing orders and trades are being made.
For example:
updates_client.onConnect(() => {
// This never gets called because it cannot connect.
console.log("Connected")
const trade_keys = ['trade_updates', 'account_updates']
updates_client.subscribe(trade_keys);
});
this is the log I get running the websocket_listener.js example:
changed to Connected2
to see 2 different connected (data_ws + updates_ws)
I am successfully able to connect to the data websocket (data_ws), but cannot connect to the trade websocket (trade_ws). I have tried on both my paper trading account as well as a live funded one.
The connection attempt to
trade_ws
is an endless loop of attempting to connect and eventually disconnecting. The logs are as follows:I am using node version: v14.3.0 and alpaca-trade-api version: ^1.4.2. I have essentially copied the code listed in examples:
Is there anything else that I am missing?
Thank you!