tradingview / charting-library-tutorial

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

Automatic switching of resolution for 1 day, although in the widget config it costs 5 minutes by default #37

Open gomel-tdl1 opened 2 years ago

gomel-tdl1 commented 2 years ago

image image I indicated in onReads supported resolution 5 minutes and 1 day. in the widget settings by default I set 5 minutes, but the schedule itself sets 1 day and 1D resolution comes to the getBars. image

timocov commented 2 years ago

Please check this field https://github.com/tradingview/charting-library-tutorial/blob/85ba9f0eab6543840646f07e1de49df7482a6ea0/src/datafeed.js#L114

usdhunter commented 2 years ago

change has_intraday: true, and 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});