Backtrader Community

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

    Topics created by Crespecular

    • C

      Shorting values are negative
      General Code/Help • • Crespecular

      5
      0
      Votes
      5
      Posts
      1667
      Views

      C

      Thanks a lot!

    • C

      To get multiple windows for plotting each multiple assets
      General Code/Help • • Crespecular

      5
      0
      Votes
      5
      Posts
      1117
      Views

      Victor Sun

      To plot each equity in a separate window, you need to loop through the strategies after running cerebro and call plot on each one individually:

      strats = cerebro.run() for i, strat in enumerate(strats): cerebro.plot(stratname=datalist[i][1], figsize=(15,8))

      This will plot each strategy in a separate figure, with the name of the equity as the title.

      The key points:

      cerebro.run() returns a list of strategy instances You can loop through this list and access each strategy Call cerebro.plot() and pass the stratname to use as the plot title Adjust the figsize as needed to control the size of each plot

      So this will give you a separate plot for each equity in your basket, rather than packing them all into one figure or splitting by time period.

      Let me know if that helps or if you have any other questions here: [https://www.qedge.co/](link url) or search "qedge"

    • C

      Rebalance quarterly
      General Code/Help • • Crespecular

      3
      0
      Votes
      3
      Posts
      1068
      Views

      B

      There is an additional path: use Docs - Timers

      You can watch day 1 of each month and only take action if the month is 3, 6, 9 or 12 or implement a callable which does the calculation and pass it to allow

    • C

      Using self CSV data failed
      General Code/Help • • Crespecular

      7
      0
      Votes
      7
      Posts
      1069
      Views

      B

      A classic example is in the Docs - Quickstart. But there is no specific documentation about classic strategies (some examples you may find implement a Moving Average CrossOver)

    • 1 / 1