{"id":13449742,"url":"https://github.com/happydasch/btplotting","last_synced_at":"2025-03-22T22:33:44.609Z","repository":{"id":41105528,"uuid":"280276632","full_name":"happydasch/btplotting","owner":"happydasch","description":"btplotting provides plotting for backtests, optimization results and live data from backtrader.","archived":false,"fork":false,"pushed_at":"2024-08-27T07:20:58.000Z","size":857,"stargazers_count":338,"open_issues_count":8,"forks_count":84,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-28T16:45:23.498Z","etag":null,"topics":["backtest","backtrader","backtrader-plotting","bokeh","live-plotting","livedata","plotting","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/happydasch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"liberapay":"happydasch"}},"created_at":"2020-07-16T23:04:36.000Z","updated_at":"2024-10-27T10:31:10.000Z","dependencies_parsed_at":"2024-01-13T17:19:05.801Z","dependency_job_id":"dbfb3fdf-b033-4127-9abb-50c6d8fc48a4","html_url":"https://github.com/happydasch/btplotting","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happydasch%2Fbtplotting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happydasch%2Fbtplotting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happydasch%2Fbtplotting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happydasch%2Fbtplotting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/happydasch","download_url":"https://codeload.github.com/happydasch/btplotting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245029294,"owners_count":20549682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtest","backtrader","backtrader-plotting","bokeh","live-plotting","livedata","plotting","visualization"],"created_at":"2024-07-31T06:00:53.106Z","updated_at":"2025-03-22T22:33:44.035Z","avatar_url":"https://github.com/happydasch.png","language":"Python","readme":"# btplotting\n\nLibrary to add extended plotting capabilities to `backtrader` (\u003chttps://www.backtrader.com/\u003e) using bokeh.\n\nbtplotting is based on the awesome `backtrader_plotting` (\u003chttps://github.com/verybadsoldier/backtrader_plotting\u003e)\n\n`btplotting` is a complete rework of `backtrader_plotting` with the live client in focus. Besides this, a lot of\nissues are fixed and new functionality is added. See the list below for differences.\n\n**What is different:**\n\nBasic:\n\n* No need for custom backtrader\n* Different naming / structure\n* Data alignment which allows to generate data for different data sources.\n  This is useful when replaying or resampling data, for example to remove gaps.\n* Support for replay data\n* Different filtering of plot objects\n* Every figure has its own ColumnDataSource, so the live client can patch without\n  having issues with nan values, every figure is updated individually\n* Plotting looks very similar to backtraders own plotting (order, heights, etc.)\n* Allows to generate custom columns, which don't have to be hardcoded.\n* This is being used to generate color for candles, varea values, etc.\n* Save images of strategy or a single data (for example save an image of data when\n  a trade is happening)\n\nPlotting:\n\n* Datas, Indicators, Observer and Volume have own aspect ratios, which can be configured in live client\n  or scheme\n* Only one axis for volume will be added when using multiple data sources on one figure\n* Volume axis position is configureable in scheme, by default it is being plotted on the right side\n* Linked Crosshair across all figures\n* _skipnan, fill_gt, fill_lt, fill support\n* Plot objects can be filtered by one or more datanames or by plot group\n* Custom plot group, which can be configured in app or in live client by providing all\n  plotids in a comma-separated list or by selecting the parts of the plot to display\n\nTabs:\n\n* Default tabs can be completely removed\n* New log panel to also include logging information\n* Can be extended with custom tabs (for example order execution with live client, custom analysis, etc.)\n\nLive plotting:\n\n**(Live plotting is broken at the moment)**\n\n* Navigation in live client (Pause, Backward, Forward)\n* Live plotting is done using an analyzer, so there is no need to use custom backtrader\n* Live plotting data update works in a single thread and is done by a DataHandler\n* Data update is being done every n seconds, which is configureable\n\n## Features\n\n* Interactive plots\n* Interactive `backtrader` optimization result browser (only supported for single-strategy runs)\n* Highly configurable\n* Different skinnable themes\n* Easy to use\n\nPython \u003e= 3.6 is required.\n\n## How to use\n\n* Add to cerebro as an analyzer:\n\n```python\nfrom btplotting import BacktraderPlottingLive\n  ...\n  ...\n\ncerebro = bt.Cerebro()\ncerebro.addstrategy(MyStrategy)\ncerebro.adddata(LiveDataStream())\ncerebro.addanalyzer(BacktraderPlottingLive)\ncerebro.run()\ncerebro.plot()\n```\n\n* If you need to change the default port or share the plotting to public:\n\n```python\ncerebro.addanalyzer(BacktraderPlottingLive, address=\"*\", port=8889)\n```\n\n## Jupyter\n\nIn Jupyter you can plot to a single browser tab with iplot=False:\n\n```python\nplot = btplotting.BacktraderPlotting()\ncerebro.plot(plot, iplot=False)\n```\n\nYou may encounters TypeError: `\u003cclass '__main__.YourStrategyClass'\u003e` is a built-in class error.\n\nTo remove the source code tab use:\n\n```python\nplot = btplotting.BacktraderPlotting()\nplot.tabs.remove(btplotting.tabs.SourceTab)\ncerebro.plot(plot, iplot=False)\n```\n\n## Demos\n\n\u003chttps://happydasch.github.io/btplotting/\u003e\n\n## Installation\n\n`pip install git+https://github.com/happydasch/btplotting`\n\n## Sponsoring\n\nIf you want to support the development of btplotting, consider to support this project.\n\n* BTC: 39BJtPgUv6UMjQvjguphN7kkjQF65rgMMF\n* ETH: 0x06d6f3134CD679d05AAfeA6e426f55805f9B395D\n* \u003chttps://liberapay.com/happydasch\u003e\n","funding_links":["https://liberapay.com/happydasch"],"categories":["Visualization","Python"],"sub_categories":["Cryptocurrencies","TimeSeries Analysis"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappydasch%2Fbtplotting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhappydasch%2Fbtplotting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappydasch%2Fbtplotting/lists"}