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/

    Broker is left intact for optstrategy?

    General Discussion
    2
    4
    840
    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.
    • D
      duality_ last edited by

      If I do cerebro.broker.getvalue() before and after a cerebro.run(), I get:

      • No change in value (i.e. 10000) if using optstrategy.
      • Change in value (e.g. 15000) if using addstrategy.

      Is there an underlying reason for this? Is it to simplify things when using addstrategy?

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

        You are comparing apples and oranges. When optimizing, each Strategy run with its own broker instance.

        1 Reply Last reply Reply Quote 0
        • D
          duality_ last edited by

          Okay makes sense now. Kind of weird that you still can access a broker, that's not active at all, can be confusing.

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

            It would seem really confusing to access a broker after running, for example, an optimization run with 1000 different options and expect a broker instance, not connected to any of those 1000 options, to have a meaningful value.

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