Backtrader Community

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

    Plotting observers

    General Code/Help
    4
    5
    2786
    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
      kicking_potato88 last edited by backtrader

      Hi, can i adjust which observers are plotted? Specifically I'm trying to just plot just the broker value line (equity curve), not the cash line. Thanks!

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

        cerebro.addobserver(bt.observers.Value)
        cerebro.run(stdstats=False)
        

        stdstats remove the default set of observers which are added to the plots. From there on the end user has to add those he/she may be interested in (like above)

        1 Reply Last reply Reply Quote 0
        • K
          kicking_potato88 last edited by

          Thanks that works. Btw, is there a way for me to just plot the broker value line only, removing even the price bars?

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

            @ng_joehoong Just like with any other object. plot=False to suppress the data.

            See the latest btfd post for an example: https://www.backtrader.com/blog/posts/2016-12-26-btfd/btfd.html

            1 Reply Last reply Reply Quote 0
            • K
              kicking_potato88 last edited by

              Perfect thanks!

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