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/

    Getting a calculated value from strategy

    General Code/Help
    2
    3
    290
    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.
    • F
      ForexBeginner last edited by

      I have a number that is calculated in the strategy when it is initialized. I would like to retrieve this variable, but it does not seem possible to get this from cerebro because it instantiates the strategy itself. What is a way around this?

      1 Reply Last reply Reply Quote 0
      • vladisld
        vladisld last edited by

        Quoting the docs: "cerebro returns the instances of the strategies it created during backtesting. This allows to analyze what they did, because all elements in the strategies are accessible"

        See here: https://www.backtrader.com/docu/cerebro/#returning-the-results

        1 Reply Last reply Reply Quote 1
        • F
          ForexBeginner last edited by

          Ah, I missed that in the documentation. Thanks a lot, my problem is solved now!

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