{"id":13449025,"url":"https://iniself.github.io/backtrader_bokeh/","last_synced_at":"2025-03-22T18:32:26.571Z","repository":{"id":153475908,"uuid":"628916870","full_name":"iniself/backtrader_bokeh","owner":"iniself","description":"Use bokeh as the backend, you will get richer plot effects for backtrader","archived":false,"fork":false,"pushed_at":"2023-04-24T16:08:53.000Z","size":405,"stargazers_count":30,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T10:14:46.137Z","etag":null,"topics":["backtrader","bokeh","investment-analysis","quantitative-finance","quantitative-investment","quantitative-trading"],"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/iniself.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.EN.md","contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2023-04-17T08:45:59.000Z","updated_at":"2025-03-13T17:00:58.000Z","dependencies_parsed_at":"2024-01-16T02:47:09.890Z","dependency_job_id":"8d4580c0-a406-46de-8a92-600977d45307","html_url":"https://github.com/iniself/backtrader_bokeh","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":0.01754385964912286,"last_synced_commit":"e8810e6d38bf20a94628b7f5e256c745df5ccae3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iniself%2Fbacktrader_bokeh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iniself%2Fbacktrader_bokeh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iniself%2Fbacktrader_bokeh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iniself%2Fbacktrader_bokeh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iniself","download_url":"https://codeload.github.com/iniself/backtrader_bokeh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245002989,"owners_count":20545532,"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":["backtrader","bokeh","investment-analysis","quantitative-finance","quantitative-investment","quantitative-trading"],"created_at":"2024-07-31T06:00:28.844Z","updated_at":"2025-03-22T18:32:21.549Z","avatar_url":"https://github.com/iniself.png","language":"Python","funding_links":[],"categories":["可视化"],"sub_categories":[],"readme":"# Important Note!\nBacktrader_Bokeh has been fully upgraded to [Noba](https://github.com/iniself/noba) which has richer feature, such as ioc container, event system, pipeline system, and a database abstraction layer\n\nPerhaps you should not use this Backtrader_Bokeh again, but if you insist on using it, there is no problem, and we also provide support.\n\nThe following is README to the Backtrader_Bokeh. \n\nRegards\n\n# Backtrader_Bokeh \n\n**You can visit our wiki homepage for more information: [EN](https://github.com/iniself/backtrader_bokeh/wiki) | [中文](https://github.com/iniself/backtrader_bokeh/wiki/wiki-zh)**\n\n`Backtrader_Bokeh` to add extended plotting capabilities to [Backtrader](https://www.backtrader.com/) using [Bokeh](https://bokeh.org/) based on the awesome [backtrader_plotting](https://github.com/verybadsoldier/backtrader_plotting) and [btplotting](https://github.com/happydasch/btplotting). Besides this, a lot of issues 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* Different data generation which allows to generate data for different data sources.\n  This is useful when replaying or resampling data, for example to remove gaps.\n* Different filtering of plot objects\n* Support for replay data\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* Display of plots looks more like backtrader plotting (order, heights, etc.)\n* Allows to generate custom columns, which don't have to be hardcoded. This is being used to generate\n  color for candles, varea values, etc.\n* Possibility to fill gaps of higher timeframes with data\n\nPlotting:\n\n* Datas, Indicators, Observer and Volume have own aspect ratios, which can be configured in live client\n  or scheme\n* Different datafeed's plot sytle can be customize separately\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* 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-seperated 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* 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* Support keyboard operation\n* Interactive `backtrader` optimization result browser (only supported for single-strategy runs)\n* Highly configurable\n* Different skinnable themes\n* In addition to OHLC, additional datafeed line can be ploted\n* Easy to use\n\n## Bug fixed\n\nSome examples, more detail in CHANGELOG.md\n \n* Many bugs in Backtrader that have not been still fixed, Backtrader_Bokeh fixed those through Monkey Patch  \n* Because of optbrowser address and port assignment problem, if port 80 is occupied, the web page will not be opened in the optimization mode. *\\* live mode is the same way*\n* Very imortant, fixed the legend can't be displayed in the observer or indicators's figuer\n* And more...\n\n\n\n***\n\nPython \u003e= 3.6 is required.\n\n\n## How to use\nJust give **Live Mode** example, about **Normal Mode** and **Optstrategy Mode** pls refer to [wiki-en](https://github.com/iniself/backtrader_bokeh/wiki) | [wiki-中文](https://github.com/iniself/backtrader_bokeh/wiki/wiki-zh)\n* Add to cerebro as an analyzer **(Live Mode)**:\n```python\nfrom backtrader_bokeh import bt\n  ...\n  ...\n\ncerebro = bt.Cerebro()\ncerebro.addstrategy(MyStrategy)\ncerebro.adddata(LiveDataStream()) # Note! Data is must Live Data\ncerebro.addanalyzer(bt.analyzers.Live, force_plot_legend=True, autostart=True)\ncerebro.run()\n# cerebro.plot() # do not run this line unless your data is not real-time\n```\n\n* If you need to change the default port or share the plotting to public:\n\n```python\ncerebro.addanalyzer(bt.analyzers.Live, address=\"localhost\", port=8889)\n```\n\n## Jupyter\n\nIn Jupyter you can plut to a single browser tab with iplot=False:\n\n```python\nfrom backtrader_bokeh import bt\nplot = bt.Bokeh()\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\nfrom backtrader_bokeh import bt\nplot = bt.Bokeh()\nplot.tabs.remove(bt.tabs.SourceTab)\ncerebro.plot(plot, iplot=False)\n```\n\n## Demos\n\n\u003chttps://iniself.github.io/backtrader_bokeh/\u003e\n\n## Contact us\nTelegram Channel: [Aui_Say](https://t.me/aui_say)\nDiscord Server: [Aui and Friends](https://discord.gg/dhp8uzKSfR)\n\n## Installation\n\n`pip install backtrader_bokeh`\n\nor\n\n`pip install git+https://github.com/iniself/backtrader_bokeh`\n\n## Sponsoring\n\nIf you want to support the development of backtrader_bokeh, consider to support this project.\n\n* ETH: 0x0275779f70179748C6fCe1Fe5D7638DfA7e3F986\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/iniself.github.io%2Fbacktrader_bokeh%2F","html_url":"https://awesome.ecosyste.ms/projects/iniself.github.io%2Fbacktrader_bokeh%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/iniself.github.io%2Fbacktrader_bokeh%2F/lists"}