From dfe1eafba93fbe3220ed44b9c0be8c550ddfcefa Mon Sep 17 00:00:00 2001 From: David Brazda Date: Fri, 4 Oct 2024 21:58:03 +0200 Subject: [PATCH] multindex indicator support --- README.md | 2 ++ lightweight_charts/helpers.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 95166e7..1e78434 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ ohlcv_complex_df.lw.plot() #df containing ohlcv and other columns ``` ![alt text](image-5.png) ```python +t1data.ohlcv.data["BAC"].lw.plot(left=[(t1mom,"mom"),(t1mom_tt.mom.loc[:, (20,"1T")],),(t1mom_tt.mom.loc[:, (20,"5T")],)]) #display ohlcv 1m data along with 1min momentum ind and 2 multiindexed indicators on 1M and 5m resolution on 5M (calculated as multiindex) + #quick few liner, displays close series with label "close" on right pricescale and rsi on left price scale, all on single Panel pane1 = Panel( right=[(close, "close")], diff --git a/lightweight_charts/helpers.py b/lightweight_charts/helpers.py index 6c8b006..ee08dec 100644 --- a/lightweight_charts/helpers.py +++ b/lightweight_charts/helpers.py @@ -430,7 +430,7 @@ def chart(panes: list[Panel], sync=False, title='', size="m", xloc=None, session tmp.set(output_series) else: if name is None: - name = "no_name" + name = "no_name" if not hasattr(series, 'name') or series.name is None else str(series.name) tmp = active_chart.create_line(name=name, priceScaleId=att_name)#, color="blue") tmp.set(xloc_me(series, xloc)) diff --git a/setup.py b/setup.py index d6926a4..2775ead 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r', encoding='utf-8') as f: setup( name='lightweight_charts', - version='2.2.1', + version='2.2.2', packages=find_packages(), python_requires='>=3.8', install_requires=[