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 avoid plotting of strategy data

    General Code/Help
    2
    7
    2695
    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.
    • I
      Ivan last edited by

      Hi,
      please, is it possible to use some data in the strategy (e.g. resampled data) but not to plot them? I would like to keep my plot as simple as possible, especially when I use many input data.
      Thanks

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

        A data feed is handled like other objects and supports the plotinfo scheme to control plotting (with the attribute plot which is a boolean with default value True for data feeds)

        See here Docs - Plotting

        This blog post shows it in action, because only plotting of the observers was wished Blog - BTFD

        1 Reply Last reply Reply Quote 0
        • I
          Ivan last edited by

          Aha, I see:
          data = YahooData(dataname=args.data, plot=False, **kwargs)

          Thanks a lot

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

            Like with other objects, you an also create it and then do (may seem cleaner in many cases)

            data = bt.feeds.MyChosenFeed(dataname=..., someparam=xxx, anotherparam=yyyy)
            data.plotinfo.plot = False
            

            Passing plot=False works (as explained in the documentation), because any kwarg not recognized as a parameter for the object, will then be matched, if possible, to the plotinfo attributes.

            1 Reply Last reply Reply Quote 0
            • I
              Ivan last edited by

              What if I want to plot the indicator (based on resampled data) on the original chart but I don't want to plot the chart for resampled data, is this possible? I am not able to achieve this.

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

                Look for the plotmaster option in Docs - Plotting

                1 Reply Last reply Reply Quote 0
                • I
                  Ivan last edited by

                  Thanks! It was my mistake.

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