Navigation

    Backtrader Community

    • Register
    • 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/

    How to get return values for every closed trade?

    General Code/Help
    2
    5
    48
    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.
    • Z
      zuj last edited by

      I am trying to create a Monte Carlo simulation that's why I require return values for every closed trade, I don't see any analyzer that can give me that. returns from the pyfolio analyzer is giving portfolio returns. Any help will be appreciated.

      run-out 1 Reply Last reply Reply Quote 0
      • run-out
        run-out @zuj last edited by

        @zuj Created by @ab_trader Trade_List I use it every day :)

        Z 1 Reply Last reply Reply Quote 2
        • Z
          zuj @run-out last edited by

          @run-out Thanks bro

          1 Reply Last reply Reply Quote 0
          • Z
            zuj last edited by

            @run-out It throws an error

                 45             dir = 'short'
            ---> 46             if trade.history[0].event.size > 0: dir = 'long'
                 47 
                 48             pricein = trade.history[len(trade.history)-1].status.price
            
            IndexError: list index out of range
            
            run-out 1 Reply Last reply Reply Quote 0
            • run-out
              run-out @zuj last edited by

              @zuj Set tradehistory =True

              cerebro.run(tradehistory=True)
              
              1 Reply Last reply Reply Quote 2
              • 1 / 1
              • First post
                Last post
              Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
              $(document).ready(function () { app.coldLoad(); }); }