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/

    Optimization sometimes returns 0 when I have more than a small number of variations

    General Code/Help
    1
    2
    265
    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.
    • E
      ElliotP last edited by

      Evening,

      I will post some more detailed code tomorrow after I have thought about it a bit more, but, at the moment when I run optimizations for more than say 18 variations, 95% of the return results just return a 0 PnL and 0 trades made despite me not being able to work out why. When I manually test the variations they work, trade and produce a PnL.

      Is it possible to run too many optimizations or are there common pitfalls to be aware of which causes this sort of things?

      1 Reply Last reply Reply Quote 0
      • E
        ElliotP last edited by ElliotP

        I have redone the strategy, made it basic, etc; it seems to be related to the maxcpu's value.

        When I set maxcpu=6, it produces 6 optimizations of trades. When I do not set it, it produces 8, when i set maxcpu to 2 it produces 2.

        Hmm, my computer has eight cores but I can't think why it is doing this.

        When I remove extactbars=-2, it has no effect.


        Here is a link to the project files:

        I am using pycharm with ib_insync to pull the data. The Instance file is titled "Astroworld1" and the Strategy file is titled "NextDayStrategyBins1"

        I am absolutely stumped as to why this has started happening.


        I have just discovered in my trade analyzer it is not showing anything under the won/lost keys of the analyzer's odict; but under the 'long' and 'short' odict it is showing values. Not sure how this might relate to the PnL = 0 problem

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }