from backtrader_extends.engine importBacktraderEnginefrom backtrader_extends.performance import PerformanceUtils from gui.bokeh_utils importBokehUtilsdf = CSVDataloader.get_backtrader_df('000300.SH', start_date='20050101') df.dropna(inplace=True) print(df) e = BacktraderEngine(df, init_cash=100 * ...
Backtrader_Bokeh 也是以这样的分类来配置绘图选项的。在继承了大部分 Backtrader 配置的前提下[1],Backtrader_Bokeh 根据 Bokeh 的需要还增加了大量配置。简言之,Backtrader_Bokeh'Options = Backtrader'Options + Bokeh'Options “系统”和“主题”的绘图选项 style str 控制主图显示的类型。single显示收盘价的线条图...
我们今天重点来说说backtrader_plotting这个扩展包,它是基于bokeh,这个包我们之前单独介绍过。pandas_bokeh:投资量化平台可视化的利器 使用pip直接安装:pip install backtrader_plotting。 github上的开源地址: 网页链接 01 基础使用 from backtrader_plotting import Bokeh from backtrader_plotting.schemes import Tradimo plot...
frombacktrader_extends.performanceimportPerformanceUtils fromgui.bokeh_utilsimportBokehUtils df = CSVDataloader.get_backtrader_df('000300.SH',start_date='20050101') df.dropna(inplace=True) print(df) e = BacktraderEngine(df,init_cash=100*100*10000.0) awaite.async_run_strategy(TurtleStrategy) equity...
为backtrader添加扩展绘图功能的backtrader ( )。 目前唯一可用的后端是Bokeh ( )。 特征 互动图 实时交易支持(需要自定义backtrader - 请参阅 Wiki 以获取更多信息) 数据回放支持 交互式backtrader优化结果浏览器(仅支持单策略运行) 可自定义的选项卡面板 ...
frombacktrader_bokehimportbtplot=bt.Bokeh()cerebro.plot(plot,iplot=False) You may encounters TypeError:<class '__main__.YourStrategyClass'>is a built-in class error. To remove the source code tab use: frombacktrader_bokehimportbtplot=bt.Bokeh()plot.tabs.remove(bt.tabs.SourceTab)cerebro.plot...
Noba not only backtrader as a quantitative investment platform, but also visualized using bokeh, which can get richer plot effects. Additionally, Noba also provide 'Ioc Container', 'Event System', 'Database Abstraction Layer', 'Pipeline System' and more. ...
from backtrader_plotting import Bokeh from backtrader_plotting.schemes import Tradimo plotconfig = { 'id:ind#0': dict( subplot=True, ), } b = Bokeh(style='line', scheme=Tradimo(), plotconfig=plotconfig) self.cerebro.plot(b) def show_result_empyrical(self, returns): import empyrical pr...
# b=Bokeh(style='bar',tabs='single') # cerebro.plot(b) def get_data(code,strategy, start_date, end_date): df_tdx = pd.read_feather(f'{stockpath}/{code}.feather') df_tdx.index = pd.to_datetime(df_tdx.date, format='%Y%m%d') df_tdx_b = df_tdx.truncate(before=start...
def_bokeh_plot(self): frombacktrader_plottingimportBokeh frombacktrader_plotting.schemesimportTradimo plotconfig = { 'id:ind#0':dict( subplot=True, ), } b = Bokeh(style='line',scheme=Tradimo(),plotconfig=plotconfig) self.cerebro.plot(b) ...