All Projects → verybadsoldier → Backtrader_plotting

verybadsoldier / Backtrader_plotting

Licence: gpl-3.0
Plotting addon for backtrader to support Bokeh (and maybe more)

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Backtrader plotting

Gaston.jl
A julia front-end for gnuplot.
Stars: ✭ 111 (-50.88%)
Mutual labels:  plotting
Holoviews
With Holoviews, your data visualizes itself.
Stars: ✭ 2,065 (+813.72%)
Mutual labels:  plotting
Eeg 101
Interactive neuroscience tutorial app using Muse and React Native to teach EEG and BCI basics.
Stars: ✭ 199 (-11.95%)
Mutual labels:  plotting
Nim Plotly
plotting library for nim-lang
Stars: ✭ 121 (-46.46%)
Mutual labels:  plotting
Cmasher
Scientific colormaps for making accessible, informative and 'cmashing' plots
Stars: ✭ 149 (-34.07%)
Mutual labels:  plotting
Scientific Visualization Book
An open access book on scientific visualization using python and matplotlib
Stars: ✭ 6,336 (+2703.54%)
Mutual labels:  plotting
Gdl
GDL - GNU Data Language
Stars: ✭ 104 (-53.98%)
Mutual labels:  plotting
Pgfplotsx.jl
Create plots in Julia using the PGFPlots LaTeX package
Stars: ✭ 210 (-7.08%)
Mutual labels:  plotting
Tidyheatmap
Draw heatmap simply using a tidy data frame
Stars: ✭ 151 (-33.19%)
Mutual labels:  plotting
Oxyplot
A cross-platform plotting library for .NET
Stars: ✭ 2,466 (+991.15%)
Mutual labels:  plotting
Ipyvolume
3d plotting for Python in the Jupyter notebook based on IPython widgets using WebGL
Stars: ✭ 1,696 (+650.44%)
Mutual labels:  plotting
Hep
hep is the mono repository holding all of go-hep.org/x/hep packages and tools
Stars: ✭ 146 (-35.4%)
Mutual labels:  plotting
Sensor Data Logger
Android Wear sensor data plotter
Stars: ✭ 166 (-26.55%)
Mutual labels:  plotting
Implot
Immediate Mode Plotting
Stars: ✭ 2,014 (+791.15%)
Mutual labels:  plotting
Webgl Plot
A high-Performance real-time 2D plotting library based on native WebGL
Stars: ✭ 200 (-11.5%)
Mutual labels:  plotting
Physt
Python histogram library - histograms as updateable, fully semantic objects with visualization tools. [P]ython [HYST]ograms.
Stars: ✭ 107 (-52.65%)
Mutual labels:  plotting
Winston.jl
2D plotting for Julia
Stars: ✭ 153 (-32.3%)
Mutual labels:  plotting
Hanami
Interactive arts and charts plotting with Clojure(Script) and Vega-lite / Vega. Flower viewing 花見 (hanami)
Stars: ✭ 216 (-4.42%)
Mutual labels:  plotting
Matplotlib
matplotlib: plotting with Python
Stars: ✭ 14,738 (+6421.24%)
Mutual labels:  plotting
Scikit Plot
An intuitive library to add plotting functionality to scikit-learn objects.
Stars: ✭ 2,162 (+856.64%)
Mutual labels:  plotting

backtrader_plotting

Library to add extended plotting capabilities to backtrader (https://www.backtrader.com/). Currently the only available backend is Bokeh (https://bokeh.org/).

Features

  • Interactive plots
  • Interactive backtrader optimization result browser (only supported for single-strategy runs)
  • Highly configurable
  • Different skinnable themes
  • Easy to use

Feel free to test it and play with it. I am happy about feedback, critics and ideas on backtrader forum (and also in GitHub issues): https://community.backtrader.com/topic/813/bokeh-integration-interactive-webbrowser-plotting

Needs Python >= 3.6.

Demos

https://verybadsoldier.github.io/backtrader_plotting/

Installation

pip install backtrader_plotting

Quickstart

from backtrader_plotting import Bokeh
from backtrader_plotting.schemes import Tradimo

<your backtrader code>

b = Bokeh(style='bar', plot_mode='single', scheme=Tradimo())
cerebro.plot(b)

Minimal Example

import datetime

import backtrader as bt

from backtrader_plotting import Bokeh


class TestStrategy(bt.Strategy):
    params = (
        ('buydate', 21),
        ('holdtime', 6),
    )

    def next(self):
        if len(self.data) == self.p.buydate:
            self.buy(self.datas[0], size=None)

        if len(self.data) == self.p.buydate + self.p.holdtime:
            self.sell(self.datas[0], size=None)


if __name__ == '__main__':
    cerebro = bt.Cerebro()

    cerebro.addstrategy(TestStrategy, buydate=3)

    data = bt.feeds.YahooFinanceCSVData(
        dataname="datas/orcl-1995-2014.txt",
        # Do not pass values before this date
        fromdate=datetime.datetime(2000, 1, 1),
        # Do not pass values after this date
        todate=datetime.datetime(2001, 2, 28),
        reverse=False,
        )
    cerebro.adddata(data)

    cerebro.run()

    b = Bokeh(style='bar', plot_mode='single')
    cerebro.plot(b)

Plotting Optimization Results

Another way to use this package is to use the OptBrowser to browse a backtrader optimization result:

...
cerebro.optstrategy(TestStrategy, buydate=range(1, 10, 1))
cerebro.addanalyzer(bt.analyzers.SharpeRatio)
...
res = cerebro.run()
bo = Bokeh()
browser = OptBrowser(bo, result)
browser.start()

This will start a Bokeh application (standalone webserver) displaying all optimization results. Different results can be selected and viewed.

It is possible possible to add further user-provided columns. When dealing with huge amounts of optimization results the number of results can be limited and the remaining results can be sorted by a user-provided function to allow for simple selection of the best results.

Documentation

Please refert to the Wiki for further documentation: https://github.com/verybadsoldier/backtrader_plotting/wiki

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].