Bar by bar data? #11
Answered
by
Mathieu2301
maritalweeping
asked this question in
Q&A
-
Hey Matheiu, Thanks for the fantastic piece of code. Maybe a stupid question but is it possible to obtain bar by bar (eg 5min OHLC) information for a ticker? |
Beta Was this translation helpful? Give feedback.
Answered by
Mathieu2301
Oct 20, 2021
Replies: 2 comments
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Mathieu2301
-
Awesome. Thanks a ton!
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes ! You can use a Chart :
The
periods[0]
is the last candle.