tysonwu / dash-tradingview

Tradingview Lightweight Charts wrapper for Plotly Dash apps
MIT License
126 stars 22 forks source link

Add cloud area or splitted lines #4

Open Samantha788 opened 1 year ago

Samantha788 commented 1 year ago

Hi dude, fantastic library I tried to use cloud series but did not work. Can you please add it to current library? Also, how to plot pivot points for seperate days? It does not have the option to split lines unless plot multiple list which is not efficient for live data. Is it possible to make candlestick width adjustable ? So it can overlap each other ? the repo is here for cloud series https://github.com/mastermobin/lightweight-charts/blob/cloud-area-chart/docs/cloud-area-series.md

tysonwu commented 1 year ago

Hi @Samantha788 thank you for trying out the component! Cloud series like ichimoku / channels like bollinger band were not supported in the original charting library offered by tradingview - only the six series types were offered. Although modified series types are possible by "hacking" the library, it is better for this Dash wrapper to respect the offerings from the charting library (so as to keep in sync with the latest tradingview versions too).

The best we can do here to mimic a cloud indicator might be using two line series (or perhaps one area series and one line series) - line color can be set across time and need to be a single color throughout.

If you want a complete legit cloud indicator while using Dash, you can consider injecting js scripts in Dash if you have basic literacy in js. You may lose interactivity in Dash components however.

Not very sure about pivot points in your question, but I assume the library itself is pretty efficient in rendering plots even when data itself were updated very frequently in live. Let me know if you encounter bottlenecks in performance.

Samantha788 commented 1 year ago

Hi @tysonwu,

thanks for prompt response. I understood what you saying however, I think current libs has limitation. Plotting 100 of series instead of making it splitting lines or filled area is not efficient and I do see performance getting worse when adding multiple series as a pivot points per day. Have a look at the image. So if want to plot zone it is not possible pink rectangle and also look at blue dots. These are pivot points. Let me know your thoughts or if you think it is possible to draw filled color rectangle in current lib fast for multiple times. D1AF0DD6-AAB3-4042-AD04-58BE88EA76ED