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/

    quick start optimization example output problem

    General Code/Help
    2
    2
    1209
    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.
    • A
      asuralm last edited by

      This is a bizarre problem. I copy and paste the last example i.e. the optimization one in the QuickStart page!
      https://www.backtrader.com/docu/quickstart/quickstart.html

      I made a small modification to the datafeed but the rest are exactly the same.
      If I use Visual Studio to run the code, I have got the same console output as shown in the webpage.

      But if I use IDLE, my python version is 3.5.2, the code gives me the result something like
      0_1491981494424_upload-c2ddff04-dea8-4faf-9dbb-7234b3679f58

      There is no output at all. If I write a print function in the name='main', it will print normally.

      However, if I don't use the optstrategy but use addstrategy(TestStrategy), the output works find and I can get output.
      0_1491981577728_upload-8ea0618e-4588-4e77-98be-469b998107dd

      It seems that the optstrategy hides the print output somehow.

      Any help please?
      Thanks

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

        It may be the same root cause as spyder and other shells which take over the initialization and prevent multiprocessing from working. Some references:

        • https://github.com/mementum/backtrader/issues/118
        • https://github.com/mementum/backtrader/issues/133
        • http://stackoverflow.com/questions/38884587/multithreading-frozen-in-python-spyder-but-not-command-prompt-windows-10
        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors