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/

    optimizing single param across portfolio.

    General Code/Help
    3
    3
    522
    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.
    • B
      blonc last edited by

      I have a single pairs strategy that is dynamically created based on N numbers of pairs that is in a dictionary. Getting to backtest this is all pretty straight forward. My question is that every strategy has a 'delta' parameter and i wanna know if its possible to optimize a single param across all strategies. When I look at the code for optimization

      strats = cerebro.optstrategy( TestStrategy, delta=range(1, 200), )

      it seems that a new instants of cerebro.optstrategy() has to be created for every strategy ? I want to optimize the single variable as a whole not per strategy, hopefully i am making sense and someone can point me in the right direction.

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

        Just guessing, since no code shown and description is not really clear.
        Create super-strategy = portfolio strategy, which calls all other strategies in it and optimize it.

        • 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 0
        • B
          backtrader administrators last edited by

          The main point here is: there is a single strategy which is used against different pairs.

          The optimization is to optimize the parameters of a strategy. What you want is to optimize for pairs and that's something which is not the target of the optimization. For each pair you can optimize the other parameters.

          But if you insist (from your other post) in that data feeds are passed as params you will probably hit a wall with the optimization approach.

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