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/

    Save analyzer Output to Log

    General Code/Help
    4
    4
    1736
    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.
    • C
      cwse last edited by

      Hi,

      I am currently saving 'all' BT output to a logfile, however I am not sure how to save the last 'printout' from the analyzers. Is there someplace in the code I can opt to have the output written to a file?

      Thank you!

      Curtis Miller 1 Reply Last reply Reply Quote 0
      • Curtis Miller
        Curtis Miller @cwse last edited by

        @cwse Maybe look at providing an instruction in the stop() method (either in the strategy or analyzer; I'm not sure which, but my hunch is you'd look to the strategy) to log final output. I have not done this myself, so I'm speaking out of ignorance, but that would be what I'd try.

        Blog posts: Walk Forward Analysis Demonstration, Stock Trading Analytics and Optimization

        Books/Video Courses: Unpacking NumPy and Pandas

        1 Reply Last reply Reply Quote 0
        • A
          ab_trader last edited by ab_trader

          writer saves all data as .csv files.

          docs - writer

          • If my answer helped, hit reputation up arrow at lower right corner of the post.
          • Python Debugging With Pdb
          • New to python and bt - check this out
          1 Reply Last reply Reply Quote 1
          • B
            backtrader administrators last edited by

            The actual output produced by an analyzer is free. It is regularly a dict but must not be. It is whatever is returned by get_analysis and as such free format.

            The Writer, which as pointed out by @ab_trader writes everything to a file, tries to take into account as much as possible to produce a sensible output, but this may not work with all possible return values of get_analysis

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