From e6bb320c566604d806ee94d81e11c7730c2ad44b Mon Sep 17 00:00:00 2001 From: Jon Eyrick Date: Wed, 6 Dec 2017 23:02:43 -0800 Subject: [PATCH] Added WebSocket 24h price change tickers --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index 2065722f..3b9139bc 100644 --- a/README.md +++ b/README.md @@ -1210,6 +1210,49 @@ binance.candlesticks("BNBBTC", "5m", function(ticks, symbol) { # WebSockets Implementation +#### Get 24h Price Change Statistics via WebSocket +```js +// For all symbols: +binance.websockets.prevDay(false, function(response) { + console.log(response); +}); + +// For a specific symbol: +binance.websockets.prevDay('BNBBTC', function(response) { + console.log(response); +}); +``` + +
+ View Response + +``` +{ eventType: '24hrTicker', + eventTime: 1512629577435, + symbol: 'BNBBTC', + priceChange: '-0.00002671', + percentChange: '-12.844', + averagePrice: '0.00019282', + prevClose: '0.00020796', + close: '0.00018125', + closeQty: '55.00000000', + bestBid: '0.00018038', + bestBidQty: '580.00000000', + bestAsk: '0.00018125', + bestAskQty: '144.00000000', + open: '0.00020796', + high: '0.00021300', + low: '0.00017555', + volume: '3731915.00000000', + quoteVolume: '719.59011818', + openTime: 1512543177433, + closeTime: 1512629577433, + firstTradeId: 2248079, + lastTradeId: 2284725, + numTrades: 36647 } +``` +
+ #### Get Candlestick Updates via WebSocket ```javascript // Periods: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M