Closed marccasco closed 6 years ago
I add:
I'm trying to do it with the prevDay, and closing the connection and neither.
Example: binance.websockets.terminate ('ethbtc @ ticker');
Answer: ['WebSocket closed: ethbtc @ ticker (1006)']
But the same thing keeps happening to me,
Thank you.
I can not reproduce your issue, sorry. Here is what I do:
binance.websockets.depthCache(['BTCUSDT', 'BNBBTC'], (symbol, depth) => {
const limit = 500;
// Note: 'cumulative' is meant for drawing a depth chart, remove if you want it just like the order book
let bids = binance.sortBids(depth.bids, limit, 'cumulative');
let asks = binance.sortAsks(depth.asks, limit, 'cumulative');
console.log(bids,asks);
//console.log(symbol+" depth cache update");
//console.log("best bid: "+binance.first(bids));
//console.log("best ask: "+binance.first(asks));
//let output = {bids:binance.array(bids), asks:binance.array(asks)};
//console.log(symbol,output);
// save information to json file
fs.writeFile("json/depth/"+symbol+".json", JSON.stringify(output, null, 4), (err)=>{});
});
binance.prevDay(false, (error, prevDay) => {
for ( let obj of prevDay ) {
let symbol = obj.symbol;
console.log(symbol+" volume:"+obj.volume+" change: "+obj.priceChangePercent+"%");
}
fs.writeFile("json/prevDay.json", JSON.stringify(prevDay, null, 4), (err)=>{});
});
Title
Short Description:
Platform:
node version:
Long descrption
code
result
Thank you very much and sorry for the inconvenience