multindex indicator support

This commit is contained in:
David Brazda
2024-10-04 21:58:03 +02:00
parent 8b9f3ad61f
commit dfe1eafba9
3 changed files with 4 additions and 2 deletions

View File

@ -44,6 +44,8 @@ ohlcv_complex_df.lw.plot() #df containing ohlcv and other columns
``` ```
![alt text](image-5.png) ![alt text](image-5.png)
```python ```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 #quick few liner, displays close series with label "close" on right pricescale and rsi on left price scale, all on single Panel
pane1 = Panel( pane1 = Panel(
right=[(close, "close")], right=[(close, "close")],

View File

@ -430,7 +430,7 @@ def chart(panes: list[Panel], sync=False, title='', size="m", xloc=None, session
tmp.set(output_series) tmp.set(output_series)
else: else:
if name is None: 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 = active_chart.create_line(name=name, priceScaleId=att_name)#, color="blue")
tmp.set(xloc_me(series, xloc)) tmp.set(xloc_me(series, xloc))

View File

@ -5,7 +5,7 @@ with open('README.md', 'r', encoding='utf-8') as f:
setup( setup(
name='lightweight_charts', name='lightweight_charts',
version='2.2.1', version='2.2.2',
packages=find_packages(), packages=find_packages(),
python_requires='>=3.8', python_requires='>=3.8',
install_requires=[ install_requires=[