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 results from multiple strategies in strategy-selection.py

    General Code/Help
    plotting multiple strategy
    1
    1
    30
    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.
    • S
      saidalateral last edited by

      Like many people I imagine, I'm interested in Backtrader as a means of defining and evaluating multiple strategies on historical stock data. I'm fairly new to Python and am hoping to be able to achieve this without having to delve too deep into the subtleties of the programming language.

      The script strategy-selection.py in the samples folder on github is touted as a simple example which runs two different strategies on one dataset.

      But how can I plot results for each strategy, or for a subset of strategies?

      cerebro.plot()

      plots the results of the first strategy, then pauses. When I close the plot window, it plots the next strategy in a new window. I would like to be able to see both at once. I can't seem to find a definitive solution in any previous posts.

      I am using 'idle' as my editor.

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