tradingview / charting-library-tutorial

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

Negative to value for resolution greater or equal to 1 week or greater #67

Open ejaznoob opened 2 years ago

ejaznoob commented 2 years ago

image

Data is being taken from Binance Kline API. Chart and its function work fine with resolutions lesser than week. I cannot figure out what is wrong and what should be done here.

has_intraday: true,
has_weekly_and_monthly: true,

To make it compatible with all resolutions but still it does not work greater than 1 week.

Ahmad-Ghorbani commented 2 years ago

Hi @ejaznoob, I hope you have find the solution by now. I had the same problem. In my case, it occurred because of the way that the charting library calls the API. It sends different time intervals to the API to get data, and stops sending whenever no data is received from API. However, as can be seen, you are receiving data continuously. Therefore, it calls the API until you get 429 error (too many requests in a given amount of time). To solve the problem, you need to change the code based on your API call. You can tell the program to send a single request to the API. In order to do that, you can change this part (library.237999374a0f9a719893.js): : e && e.noData ? (this._logMessage("EOD received"), this._setEndOfData())

You can remove && e.noData to avoid sending request continuously.