tradingview / charting-library-tutorial

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

Add support intraday resolutions #13

Open axelkeegan opened 3 years ago

axelkeegan commented 3 years ago

Greetings,

thank you team for this great tutorial. I managed to switch the timeframe to 1 minute chart successfully, but getBars method is calling only once. Currently only the last bar is receiving the updates, and new bars are not generated. What needs to be done in order to call getBars every 60 seconds ?

timocov commented 3 years ago

can you provide steps to reproduce please?

axelkeegan commented 3 years ago

will provide info later today. sorry for the delay.

axelkeegan commented 3 years ago

onReady method added support for 1,5,15 minutes.

....
const configurationData = {
    supported_resolutions: ['1D', '1W', '1M'],
    exchanges: [
....

Turned intraday to true, in order to enable above resolutions

....
   has_intraday: false,
....

inside getBars method, changed

const data = await makeApiRequest(data/histoday?${query}); to

const data = await makeApiRequest(data/histominute?${query});

Basically nothing else was changed from the tutorial steps. The end result is perfectly working 1-5-15 minute TV chart, data is collected successfully. Once TV chart is ready and all bars are drawn, all next changes are drawn only on the last candle, no new candles are drawn. No matter which resolution is used 1-5-15.

Will be happy to understand how i can make it working on 1-5-15 minutes chart.

Another interesting problem is, if we have two separate servers where this tutorial is loaded, if we open them in two separate browser tab, only one of them is working because of 'CORS'. But this is another issue.

Regards,

axelkeegan commented 3 years ago

UP @timocov

timocov commented 3 years ago

Sorry for late reply.

Can you prepare a repro for that and steps for reproduce after that changes please? A repo or a git diff with changes so I can apply them and see what's going on?

Another interesting problem is, if we have two separate servers where this tutorial is loaded, if we open them in two separate browser tab, only one of them is working because of 'CORS'. But this is another issue.

Not sure how 2 tabs are related to the CORS problem.

axelkeegan commented 3 years ago

No problem for the late reply, i suppose all of us are busy enough already.

Will be hard to upload the project to repo since already deleted the project due to debug process stuck. I believe will be much easier, if you are able to share some guidance how to convert your tutorial to 1-5-15 minutes chart configuration.

Regards,

timocov commented 3 years ago

Ok, I marked it as feature request to add intraday resolutions.

axelkeegan commented 3 years ago

Highly appreciate it. Any expected ETA on it ?

Regards,

axelkeegan commented 3 years ago

UP @timocov

timocov commented 3 years ago

No, we don't have any ETA for that. If somebody wants to fix it - PRs are welcomed.

axelkeegan commented 3 years ago

Some guiding lines will be appreciated ...

Ezriral commented 3 years ago

: D ETAs are for professional companies, after you checked out their guides, you know they are not

vladyosifov commented 2 years ago

one year later no resolution ? is that hard to be introduced a way how to add intraday resolutions ?

serhatopcu commented 11 months ago

Hello, For those having same issues, I will try to answer as far as I know. You can't reach all resolutions because you are getting data by using cryptocompare websocket, you can see this in streaming.js where the line "wss://streamer.cryptocompare.com", you need to pay for all resolutions, but cryptocompare is not only option to get data from, for example i am getting minute resolution data from binance websocket for free.