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/

    Plot not showing correctly when adding 2nd data feed

    General Code/Help
    1
    1
    39
    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.
    • jkcaldwe
      jkcaldwe last edited by

      Hi All,

      I am having an issue when plotting with multiple data feeds. When I add a second data feed to cerebro, the plot lines of the 'Trades' observer subplot change to triangles and no longer use Blue and Red to show winning and losing trades. I have tried to re-specify the plot lines using the code below but am not having success changing the appearance.

      SPYData.plotinfo.plotlines = dict(
      Trades=dict(
      pnlplus=dict(_name='Positive', marker='o', color='blue', markersize=8.0, fillstyle='full'), 
      pnlminus=dict(_name='Negative', marker='o', color='red', markersize=8.0, fillstyle='full')));
      

      As an example, if I add only one data feed to cerebro I get the chart below, as expected, with Blue and Red dots in the 'Trades' observer subplot.

      004fd95a-8fae-4770-967f-e86dee642a77-image.png

      Now if I add a second data feed to cerebro I get the following chart. As can be seen, Red and Blue circles change to green triangles. Also, the 'Trades' subplot name turns to 'DataTrades (True)'.

      6dce5922-fdfa-4cff-b099-890abebc09a6-image.png

      Thanks in advance for the help.

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