Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. jkcaldwe
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    jkcaldwe

    @jkcaldwe

    0
    Reputation
    10
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    jkcaldwe Unfollow Follow

    Latest posts made by jkcaldwe

    • Plot not showing correctly when adding 2nd data feed

      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
      posted in General Code/Help
      jkcaldwe
      jkcaldwe