is setInterval to listen to the ticker mandatory?
Closed this issue · 4 comments
Hi,
Thanks for this great tool.
I was just wandering if I need to listen to the ticker changes with new setInterval like:
const TradingViewAPI = require('tradingview-scraper');
const tv = new TradingViewAPI();
setInterval(() => tv.getTicker('EURUSD').then(result => {
console.log(result)
}), 1000);
Or I'm doing it wrong? because firing the tv.getTicker(ticker) is returning only one response.
Hey,
Thanks for your interest in my project.
As this tool was made because I needed just the current ticker data there's no event support, but actually, since I was going to update the library soon (the codebase is really dirty), I may implement it in next version. I'll leave this issue open as a feature request. If anyone wants to implement this feature faster than me and submit a PR, you're more than welcome.
So answering your question: yes, that's the only way at the moment.
Best regards,
Piotr Adamczyk
The new version was made available on NPM, so I'm closing this as it's no longer relevant.