update docs
This commit is contained in:
@ -22,12 +22,12 @@ ___
|
|||||||
## Features
|
## Features
|
||||||
1. Streamlined for live data, with methods for updating directly from tick data.
|
1. Streamlined for live data, with methods for updating directly from tick data.
|
||||||
2. Multi-pane charts using [Subcharts](https://lightweight-charts-python.readthedocs.io/en/latest/reference/abstract_chart.html#AbstractChart.create_subchart).
|
2. Multi-pane charts using [Subcharts](https://lightweight-charts-python.readthedocs.io/en/latest/reference/abstract_chart.html#AbstractChart.create_subchart).
|
||||||
3. The [Toolbox](https://lightweight-charts-python.readthedocs.io/en/latest/reference/toolbox.html), allowing for trendlines, rays and horizontal lines to be drawn directly onto charts.
|
3. The [Toolbox](https://lightweight-charts-python.readthedocs.io/en/latest/reference/toolbox.html), allowing for trendlines, rectangles, rays and horizontal lines to be drawn directly onto charts.
|
||||||
4. [Events](https://lightweight-charts-python.readthedocs.io/en/latest/tutorials/events.html) allowing for timeframe selectors (1min, 5min, 30min etc.), searching, hotkeys, and more.
|
4. [Events](https://lightweight-charts-python.readthedocs.io/en/latest/tutorials/events.html) allowing for timeframe selectors (1min, 5min, 30min etc.), searching, hotkeys, and more.
|
||||||
5. [Tables](https://lightweight-charts-python.readthedocs.io/en/latest/reference/tables.html) for watchlists, order entry, and trade management.
|
5. [Tables](https://lightweight-charts-python.readthedocs.io/en/latest/reference/tables.html) for watchlists, order entry, and trade management.
|
||||||
6. Direct integration of market data through [Polygon.io's](https://polygon.io/?utm_source=affiliate&utm_campaign=pythonlwcharts) market data API.
|
6. Direct integration of market data through [Polygon.io's](https://polygon.io/?utm_source=affiliate&utm_campaign=pythonlwcharts) market data API.
|
||||||
|
|
||||||
__Supports:__ Jupyter Notebooks, PyQt5, PySide6, wxPython, Streamlit, and asyncio.
|
__Supports:__ Jupyter Notebooks, PyQt6, PyQt5, PySide6, wxPython, Streamlit, and asyncio.
|
||||||
|
|
||||||
PartTimeLarry: [Interactive Brokers API and TradingView Charts in Python](https://www.youtube.com/watch?v=TlhDI3PforA)
|
PartTimeLarry: [Interactive Brokers API and TradingView Charts in Python](https://www.youtube.com/watch?v=TlhDI3PforA)
|
||||||
___
|
___
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Alternative GUI's
|
# Alternative GUI's
|
||||||
|
|
||||||
|
|
||||||
## PyQt5 / PySide6
|
## PyQt6 / PyQt5 / PySide6
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|||||||
@ -36,7 +36,7 @@ def on_timeframe_selection(chart):
|
|||||||
if new_data.empty:
|
if new_data.empty:
|
||||||
return
|
return
|
||||||
# The symbol has not changed, so we want to re-render the drawings.
|
# The symbol has not changed, so we want to re-render the drawings.
|
||||||
chart.set(new_data, render_drawings=True)
|
chart.set(new_data, keep_drawings=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@ -22,7 +22,7 @@ The `websockets` library is required when using live data.
|
|||||||
|
|
||||||
```{important}
|
```{important}
|
||||||
When using live data and the standard `show` method, the `block` parameter __must__ be set to `True` in order for the data to congregate on the chart (`chart.show(block=True)`).
|
When using live data and the standard `show` method, the `block` parameter __must__ be set to `True` in order for the data to congregate on the chart (`chart.show(block=True)`).
|
||||||
If `show_async` is used with live data, `block` can be either value.
|
`show_async` can also be used with live data.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ ___
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```{py:method} set(data: pd.DataFrame, render_drawings: bool = False)
|
```{py:method} set(data: pd.DataFrame, keep_drawings: bool = False)
|
||||||
Sets the initial data for the chart.
|
Sets the initial data for the chart.
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ Columns should be named:
|
|||||||
|
|
||||||
Time can be given in the index rather than a column, and volume can be omitted if volume is not used. Column names are not case sensitive.
|
Time can be given in the index rather than a column, and volume can be omitted if volume is not used. Column names are not case sensitive.
|
||||||
|
|
||||||
If `render_drawings` is `True`, any drawings made using the `toolbox` will be redrawn with the new data. This is designed to be used when switching to a different timeframe of the same symbol.
|
If `keep_drawings` is `True`, any drawings made using the `toolbox` will be redrawn with the new data. This is designed to be used when switching to a different timeframe of the same symbol.
|
||||||
|
|
||||||
`None` can also be given, which will erase all candle and volume data displayed on the chart.
|
`None` can also be given, which will erase all candle and volume data displayed on the chart.
|
||||||
```
|
```
|
||||||
@ -27,7 +27,7 @@ ___
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```{py:method} update(series: pd.Series, render_drawings: bool = False)
|
```{py:method} update(series: pd.Series, keep_drawings: bool = False)
|
||||||
Updates the chart data from a bar.
|
Updates the chart data from a bar.
|
||||||
|
|
||||||
Series labels should be akin to [`set`](#AbstractChart.set).
|
Series labels should be akin to [`set`](#AbstractChart.set).
|
||||||
|
|||||||
@ -45,7 +45,7 @@ ___
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```{py:method} show_async(block: bool)
|
```{py:method} show_async()
|
||||||
:async:
|
:async:
|
||||||
|
|
||||||
Show the chart asynchronously.
|
Show the chart asynchronously.
|
||||||
@ -85,7 +85,7 @@ ___
|
|||||||
|
|
||||||
The `QtChart` object allows the use of charts within a `QMainWindow` object, and has similar functionality to the `Chart` object for manipulating data, configuring and styling.
|
The `QtChart` object allows the use of charts within a `QMainWindow` object, and has similar functionality to the `Chart` object for manipulating data, configuring and styling.
|
||||||
|
|
||||||
Either the `PyQt5` or `PySide6` libraries will work with this chart.
|
Either the `PyQt5`, `PyQt6` or `PySide6` libraries will work with this chart.
|
||||||
|
|
||||||
Callbacks can be received through the Qt event loop.
|
Callbacks can be received through the Qt event loop.
|
||||||
___
|
___
|
||||||
|
|||||||
@ -101,7 +101,7 @@ async def update_clock(chart):
|
|||||||
async def main():
|
async def main():
|
||||||
chart = Chart()
|
chart = Chart()
|
||||||
chart.topbar.textbox('clock')
|
chart.topbar.textbox('clock')
|
||||||
await asyncio.gather(chart.show_async(block=True), update_clock(chart))
|
await asyncio.gather(chart.show_async(), update_clock(chart))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@ -130,7 +130,6 @@ async def data_loop(chart):
|
|||||||
return
|
return
|
||||||
chart.update_from_tick(ticks.iloc[i])
|
chart.update_from_tick(ticks.iloc[i])
|
||||||
await asyncio.sleep(0.03)
|
await asyncio.sleep(0.03)
|
||||||
i += 1
|
|
||||||
|
|
||||||
|
|
||||||
def on_new_bar(chart):
|
def on_new_bar(chart):
|
||||||
@ -150,7 +149,7 @@ async def main():
|
|||||||
df = pd.read_csv('ohlc.csv')
|
df = pd.read_csv('ohlc.csv')
|
||||||
|
|
||||||
chart.set(df)
|
chart.set(df)
|
||||||
await asyncio.gather(chart.show_async(block=True), data_loop(chart))
|
await asyncio.gather(chart.show_async(), data_loop(chart))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user