tensortrade.env.plotters.plotly_trading_chart module

class tensortrade.env.plotters.plotly_trading_chart.PlotlyTradingChart(*args, **kwargs)[source]

Bases: AbstractPlotter

Trading visualization for TensorTrade using Plotly.

Parameters:
  • display (bool) – True to display the chart on the screen, False for not.

  • height (int) – Chart height in pixels. Affects both display and saved file charts. Set to None for 100% height. Default is None.

  • save_format (str) – A format to save the chart to. Acceptable formats are html, png, jpeg, webp, svg, pdf, eps. All the formats except for ‘html’ require Orca. Default is None for no saving.

  • path (str) – The path to save the char to if save_format is not None. The folder will be created if not found.

  • filename_prefix (str) – A string that precedes automatically-created file name when charts are saved. Default ‘chart_’.

  • timestamp_format (str) – The format of the date shown in the chart title.

  • auto_open_html (bool) – Works for save_format=’html’ only. True to automatically open the saved chart HTML file in the default browser, False otherwise.

  • include_plotlyjs (Union[bool, str]) – Whether to include/load the plotly.js library in the saved file. ‘cdn’ results in a smaller file by loading the library online but requires an Internet connect while True includes the library resulting in much larger file sizes. False to not include the library. For more details, refer to https://plot.ly/python-api-reference/generated/plotly.graph_objects.Figure.html

Notes

Possible Future Enhancements:
  • Saving images without using Orca.

  • Limit displayed step range for the case of a large number of steps and let the shown part of the chart slide after filling that range to keep showing recent data as it’s being added.

References

registered_name = 'plotly_trading_chart'
render() None[source]
reset() None[source]

Resets the renderer.

save() None[source]

Saves the current chart to a file.

Notes

All formats other than HTML require Orca installed and server running.