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 not plot Broker and Trades?

    General Code/Help
    2
    4
    615
    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.
    • 7
      7wonders last edited by

      I am aware of the stdstats=False option but that removes a whole bunch of functionality. What I am interested in is just removing the Broker and Trades subplots on matplotlib output. In other words how to set

      plotinfo = dict(plot=True, subplot=True)
      

      To

      plotinfo = dict(plot=False)
      

      Where/how exactly is that achieved?

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

        The only way is to use stdstats=False and then add your custom set of Observers.

        stdstats is meant as a default set of reasonable observers to use. Any other combination is a user defined one.

        7 1 Reply Last reply Reply Quote 1
        • 7
          7wonders @backtrader last edited by

          @backtrader Thx for the clarification! Had literally just started writing a subclass of Observer

          class OurBroker(Broker):
              plotinfo = dict(plot=False, subplot=True)
          

          Very complicated :)

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

            Nothing would prevent you from directly monkey-patching the existing observer classes or replace them in the modules with your own subclasses, but imho, it is better to use addobserver.

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