Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    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

    General Code/Help
    2
    2
    169
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Tigran79
      Tigran79 last edited by

      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

      1 Reply Last reply Reply Quote 0
      • B
        BorutF last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors