-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websocket - Binance Websocket.chart is not working 2024 #903
Comments
Same here, just tried to use it, but the callback is streaming back the symbol string, not the data. @jhonyjss Were you able to get to the bottom of it or find an alternative? |
Hi @vitaly-t , I didn't find any alternative yet. let's watch together. |
@jhonyjss Thank you for coming back to me on this! After poking around with the API, I found that ['1m', '3m', '5m'].forEach(i => {
const endpoint = binance.futuresCandlesticks('BTCUSDT', i, c => {
if (c.k.x) {
// candle has been closed, time to update:
this.updateCandles(i, {
open: c.k.o,
close: c.k.c,
high: c.k.h,
low: c.k.l,
openTime: c.k.t,
closeTime: c.k.T,
volume: c.k.v,
tradesCount: c.k.n
});
}
});
this.socketEndpoints.push(endpoint); // save the endpoint, to close later
}); P.S. I work with Binance Futures only, I'm not interested in Spot stuff 😸 |
`
const binance = new Binance().options({
APIKEY: apiKey,
APISECRET: apiSecret,
useServerTime: true
});
binance.websockets.chart(
"BTCUSDT",
"1m",
(symbol, interval, chart) => {
console.info(chart);
}
);`
result: {}
Can you please check what's wrong ?
The text was updated successfully, but these errors were encountered: