tvjsx / trading-vue-js

💹 Hackable charting lib for traders. You can draw literally ANYTHING on top of candlestick charts. [Not Maintained]
https://tvjsx.github.io/trading-vue-demo/
MIT License
2.07k stars 629 forks source link

How to access full chart data in Overlay ? #212

Closed forzapa closed 3 years ago

forzapa commented 3 years ago

Hello, first of all thank you for your package, it is really excellent.

I was wondering if it was possible to access all the data from a component overlay? The only thing I found that comes close is 'this.layout.candles' but this array only contains the candles that appear on the screen. Is there another way to access the entire dataset?

Actually my goal is to make an overlay that will display the VWAP technical indicator, and to calculate it, I need to get the last 150 candles, even if the chart is zoomed to the maximum and only 5 candles appear on the chart.

I know I can directly assign data to the overlay but the process seems a bit cumbersome because I update my chart in real time, so every time a tick is received I have to update the data of the chart and also of the overlay. I hope i was clear enough If it's the only solution I'll deal with it, but having the possibility to access the whole dataset from an overlay seems to be a handy feature.

Thank you very much!

C451 commented 3 years ago

Hi, https://github.com/tvjsx/trading-vue-js/blob/master/docs/guide/OVERLAYS.md#accessing-all-ohlcv-data