tradingview / charting-library-tutorial

This tutorial explains step by step how to connect your data to the Charting Library
MIT License
397 stars 306 forks source link

not show complate data in timeframe 30 min #62

Open usdhunter opened 2 years ago

usdhunter commented 2 years ago

https://signal.usdhunter.com/chart/?id=63Although the complete data comes from the api, but does not display the complete on the chart, but it is correct on other timeframes. What is the problem?

usdhunter commented 2 years ago

my ip for data https://min-api.cryptocompare.com datafeed code var data=""; if (resolution === '1D') data = await makeApiRequest(data/histoday?${query}); else if (resolution >= 60 ) data = await makeApiRequest(data/histohour?${query}); else data = await makeApiRequest(data/histominute?${query}); // console.log('data',data); if (data.Response && data.Response === 'Error' || data.Data.length === 0) { // "noData" should be set if there is no data in the requested period. onHistoryCallback([], { noData: true, }); return; } let bars = []; data.Data.forEach(bar => { if (bar.time >= from && bar.time < to) { bars = [...bars, { time: bar.time * 1000, low: bar.low, high: bar.high, open: bar.open, close: bar.close, }]; } }); if (firstDataRequest) { lastBarsCache.set(symbolInfo.full_name, { ...bars[bars.length - 1], }); }