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/

    perf records for multiple strategies

    Indicators/Strategies/Analyzers
    2
    2
    884
    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.
    • K
      kev last edited by

      If i have multiple strategies (by 'cerebro.addstrategy(st0)' ...), how do I get perf records (pnl, trades, etc) for each strategy?

      B 1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators @kev last edited by

        Have a look at the Cerebro return values

        https://www.backtrader.com/docu/cerebro.html (Section: Returning the results)

        result = cerebro.run(**kwargs)
        

        The format of result returned by run will vary depending on whether optimization is used (a strategy was added with optstrategy):

        • All strategies added with addstrategy

          result will be a list of the instances run during the backtesting

        • 1 or more strategies were added with optstrategy

          result will be a list of list. Each internal list will contain the strategies after each optimization run

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