Skip to content

Bar by bar data? #11

Answered by Mathieu2301
maritalweeping asked this question in Q&A
Discussion options

You must be logged in to vote

Yes ! You can use a Chart :

const marketAPI = require('tradingview');

const market = marketAPI(false); // 'false' for chart-only mode

market.on('logged', () => {
  market.initChart({
    symbol: 'COINBASE:BTCEUR',
    period: '5',
    range: 50,
    indicators: [],
  }, (periods) => {
    console.log('Last period:', {
      price: periods[0].$prices.close,
    });
  });
});

The periods[0] is the last candle.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Mathieu2301
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants