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/

    Plot multiple data on same canvas

    General Discussion
    3
    4
    1868
    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.
    • Swapnil Jariwala
      Swapnil Jariwala last edited by

      Hello,
      I have multiple data sources (eg. NIFTY Futures, and its options). I want to plot a graph like below, from this example. In my code similar to the example I'm doing -
      cerebro.plot(valume=False) but instead I'm getting 3 different sections of plot for each of the data source.

      Graph

      1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by ab_trader

        cerebro.plot(volume=False) simply hides volume from the plot. It doesn't give you ability to plot on the same chart.

        In order to put number of data feeds on the same chart use:

        data1.plotinfo.plotmaster = data0
        

        when add data feeds. This is also shown in the example.

        • If my answer helped, hit reputation up arrow at lower right corner of the post.
        • Python Debugging With Pdb
        • New to python and bt - check this out
        P Swapnil Jariwala 2 Replies Last reply Reply Quote 1
        • P
          Paska Houso @ab_trader last edited by

          @ab_trader said in Plot multiple data on same canvas:

          This is also shown in the example.

          Good eye. It took some time to realize that the chart posted in the question was already in the linked example and was not the output of the OP (who wanted all assets on the same canvas ... as already shown in the chart)

          1 Reply Last reply Reply Quote 0
          • Swapnil Jariwala
            Swapnil Jariwala @ab_trader last edited by

            @ab_trader Thanks, Good catch.

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