Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

backtrader_plotly

Plot backtrader's result using plotly instead of the default matplotlib

This is an experimental package, and it is done by replacing original matplotlib method calls.

Installation

$ pip install backtrader-plotly==1.3.0

New Scheme Arguments

New scheme arguments are added to provide extra control

Name of Argument Default Value Description
decimal_places 5 It is used to control the number of decimal places of price shown on the plot. For instance, forex price usually consists of 5 decimal places.
max_legend_text_width 16 It is used to limit the legend text width to prevent it from occupying the page.

Usage

# import the package after installation
from backtrader_plotly.plotter import BacktraderPlotly
from backtrader_plotly.scheme import PlotScheme
import plotly.io

# do whatever you want with `backtrader`
import backtrader as bt

# for instance
cerebro = bt.Cerebro()

# after adding data and strategy
cerebro.run()

# define plot scheme with new additional scheme arguments
scheme = PlotScheme(decimal_places=5, max_legend_text_width=16)

# plot and save figures as `plotly` graph object
figs = cerebro.plot(BacktraderPlotly(show=True, scheme=scheme))
figs = [x for fig in figs for x in fig]  # flatten output
for fig in figs:
    plotly.io.to_html(fig, full_html=False)  # open html in the browser
    plotly.io.write_html(fig, file='plot.html')  # save the html file

Metadata

Release files for backtrader-plotly 1.4.0.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for backtrader-plotly 1.4.0.dev1
File Size Uploaded Provenance Actions
backtrader_plotly-1.4.0.dev1.tar.gz 23.7 kB Without provenance Details for backtrader_plotly-1.4.0.dev1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for backtrader-plotly 1.4.0.dev1
File Interpreter ABI Platform Actions
backtrader_plotly-1.4.0.dev1-py3-none-any.whl Python 3 none any Details for backtrader_plotly-1.4.0.dev1-py3-none-any.whl

Total release size: 47.2 kB

Release files / backtrader_plotly-1.4.0.dev1.tar.gz

Download URL backtrader_plotly-1.4.0.dev1.tar.gz
Size 23.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1bdd52e89bee021b3d0b6ff960827e02392166a85194b633e254899de48a18b3
BLAKE2b-256 checksum
How to use checksums
673adf1fafeaaf0a80d23b7bc5d4f17ad3f868a1a1b7eff257be96853a78182c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / backtrader_plotly-1.4.0.dev1-py3-none-any.whl

Download URL backtrader_plotly-1.4.0.dev1-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82f72a54cad6dd182121f822020dc3e4517c1bb2f2b2e54dd38a742583370888
BLAKE2b-256 checksum
How to use checksums
01f07c2bd65857d948559790c2d1fef622ea9591bfbe0fc75fe09f20613593f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Security for backtrader-plotly 1.4.0.dev1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page