Strategy reports for multiple strategies
Pierre Cilliers 0 last edited by
Just a quick one.
I have a few strategies running over the same historical data. This results in performance data (returns/positions/transactions/etc.) for each strategy run. This is computed through the following line:
results = cerebro.run(exactbars=True) results = results pyfoliozer = results.analyzers.getbyname('pyfolio') returns, positions, transactions, gross_lev = pyfoliozer.get_pf_items()
I would like to compare them via a tearsheet or (even beter) visually on a graph.
Currently I am using Quantstats to create a report (which is great, but it seems that I can only compare two strategies at a time).
returns1 = bt_results_1['returns'] #returns stored for strategy 1 returns2 = bt_results_2['returns'] #returns stored for strategy 2 #remove timezone returns = returns1.tz_localize(None) benchmark = returns2.tz_localize(None) qs.reports.html(returns=returns, benchmark=benchmark, title='EURCAD naive strategy: ma50 vs ma80', download_filename='test_bt_report_benchmark.html')
Ultimately, would one be able to compare 3/4/5 strategies at once within Backtrader?
Was hoping something like this could work:
qs.reports.html(returns=[returns1, returns2, returns3, returns4], title='EURCAD naive strategy: ma50 vs ma80', download_filename='test_bt_report_benchmark.html')