stefan-jansen / pyfolio-reloaded

Portfolio and risk analytics in Python
https://pyfolio.ml4trading.io/
Apache License 2.0
348 stars 109 forks source link

Pyfolio export output #16

Closed Tigran79 closed 1 year ago

Tigran79 commented 2 years ago

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

stefan-jansen commented 1 year ago

The library including pyfolio.show_perf_stats(df) is designed for notebook display. You could modify a local version to save to csv instead of calling utils.print_table in that function, for instance.