For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Pyfolio export output
-
Hello,
Can you please tell me how to save and export the output of pyfolio. For example how to export pifolio.show_perf_stats(df) or pifolio.show_worst_drawdown_periods(df). When i try to export pyfolio.export create_returns_tear_sheet report does not include portfolio metrics.
Thank you in advance,
Tigran Apoyan -
strat = results[0] pyfoliozer = strat.analyzers.getbyname('pyfolio') returns, positions, transactions, gross_lev = pyfoliozer.get_pf_items()
This is what the backtrader analyzer can return and then you can the returns, positions, transactions, gross_lev as arguments for the pyfolio library.