Skip to content

Commit

Permalink
Added WebSocket 24h price change tickers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Eyrick authored Dec 7, 2017
1 parent 2e985dc commit e6bb320
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
```

<details>
<summary>View Response</summary>

```
{ 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 }
```
</details>

#### Get Candlestick Updates via WebSocket
```javascript
// Periods: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M
Expand Down

0 comments on commit e6bb320

Please sign in to comment.