jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.57k stars 767 forks source link

futures candlestick #556

Open vicentxxye opened 3 years ago

vicentxxye commented 3 years ago

hey i cant get the futures candlestick like btcusdt, 1m

i find the spot way .is there any api of futures candlesticks?

// Intervals: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M binance.candlesticks("BNBBTC", "5m", (error, ticks, symbol) => { console.info("candlesticks()", ticks); let last_tick = ticks[ticks.length - 1]; let [time, open, high, low, close, volume, closeTime, assetVolume, trades, buyBaseVolume, buyAssetVolume, ignored] = last_tick; console.info(symbol+" last close: "+close); }, {limit: 500, endTime: 1514764800000});

arenddeboer commented 3 years ago

Use futuresCandlesticks

nodeBinanceApi.futuresCandlesticks(['BTCUSDT'], '1m', (candlesticks) => {
      logger.info('candlesticks', candlesticks)
      let { e: eventType, E: eventTime, s: symbol, k: ticks } = candlesticks
      let { o: open, h: high, l: low, c: close, v: volume, n: trades, i: interval, x: isFinal, q: quoteVolume, V: buyVolume, Q: quoteBuyVolume } = ticks
      logger.info(symbol + ' ' + interval + ' candlestick update')
      logger.info('open: ' + open)
      logger.info('high: ' + high)
      logger.info('low: ' + low)
      logger.info('close: ' + close)
      logger.info('volume: ' + volume)
      logger.info('isFinal: ' + isFinal)
    })