Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouping multiple lines for a single indicator #242

Open
arotabi opened this issue Jan 1, 2024 · 3 comments
Open

Grouping multiple lines for a single indicator #242

arotabi opened this issue Jan 1, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@arotabi
Copy link

arotabi commented Jan 1, 2024

Question

First of all - thank you for creating this!
I'm in the process of migrating my ugly Plotly charts to lightweight-charts :)

Is it possible to group multiple lines/plots for a single indicator?
For example, the upper and lower lines for an EMA channel to be grouped together.

image

Code example

No response

@louisnw01 louisnw01 added the enhancement New feature or request label Feb 14, 2024
@louisnw01
Copy link
Owner

Hey @arotabi,

I think this is a good idea; I'm curious if you have any ideas about how the syntax of this feature could work?

Louis

@arotabi
Copy link
Author

arotabi commented Feb 16, 2024

Hey @louisnw01,

I think the simplest way might be to introduce the option of 'group_name' to chart.create_line().
So for example
chart.create_line(name='df_line_1', color='...', style='...', width=1, price_line=False, price_label=False)

would become:
chart.create_line(group_name='my_indicator_name', name='df_line_1', color='...', style='...', width=1, price_line=False, price_label=False)
chart.create_line(group_name='my_indicator_name', name='df_line_2', color='...', style='...', width=1, price_line=False, price_label=False)

Must admit, I have no idea how hard this might be to implement or if TV's lightweight charts even allows for grouping.

Thanks,
AR

@dalklein
Copy link

This could be great for pairs or sets of lines, such as Bollinger bands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants