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/

    Noob question on plotting

    General Code/Help
    2
    3
    438
    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.
    • R
      Rstrong last edited by

      Sorry for the basic question but I cant seem to figure this out.

      When I use cerebro.plot it plots just fine but it does so before my output shows the results of the backtest.

      How do i make it so that the chart populates after the output of the script is complete?

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        That's due to the broker EOL buffering of Windows.

        If you are not running under IPython or similar (which hijack several things like multiprocessing and stdout without warning) environments, you can do the following

        import backtrader.utils.flushfile
        

        and each line of output will be flushed immediately.

        1 Reply Last reply Reply Quote 0
        • R
          Rstrong last edited by

          You are a life saver. Thank you!

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