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/

    Getting to portfolio performance data.

    General Code/Help
    4
    5
    2432
    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.
    • RandyT
      RandyT last edited by

      I'm in the process of porting a "tearsheet" writer from QSTrader. A very good friend wrote this code and I would like to have it available in BT. Check out the image below to see some of the output. Similar to Pyfolio, but focuses on the things that I believe are most important when developing systems.

      I'm close to having this working but could use a little guidance as to how to get to the following data:

      avg_bot
      avg_price
      avg_sld
      cost_basis
      init_commission
      init_price
      market_value
      net
      net_incl_comm
      net_total
      realised_pnl
      total_bot
      total_commission
      total_sld
      unrealised_pnl
      

      I see much of what I need being derived or created in tradeanalyzer.py, but not clear to me how I access this from the analyzer I am creating. Help would be appreciated. I only see self._returns, self._positions, self._transactions and self._gross_lev from where I am working which may be enough to calculate these, but I feel like this is being done somewhere else for me.

      Help much appreciated.

      0_1487722960486_Selection_NNN(084).png

      1 Reply Last reply Reply Quote 1
      • A
        ab_trader last edited by

        Agree that pyfolio has a lot of excessive information.
        If you would consider to add calmar ratio to your stats, that would be really appreciated.

        • If my answer helped, hit reputation up arrow at lower right corner of the post.
        • Python Debugging With Pdb
        • New to python and bt - check this out
        1 Reply Last reply Reply Quote 0
        • J
          jaikumarm last edited by

          maybe a trades chart with up and down arrows for when the trades were entered and exited, I use it to generally eyeball and do a sanity check on when the trades occurred and whether I as a human agree with it :)

          RandyT 1 Reply Last reply Reply Quote 0
          • C
            cnimativ last edited by

            QSTrader's tear sheet is great.

            Would be nice to get a confusion matrix as well!

            1 Reply Last reply Reply Quote 0
            • RandyT
              RandyT @jaikumarm last edited by

              @jaikumarm The trade chart is possible today with the standard cerebro.plot() function if you have the appropriate analyzers configured.

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