Backtrader Community

    • 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/

    How to optimize with a list of grouped parameters?

    General Code/Help
    2
    3
    234
    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.
    • J
      jesseliu0 last edited by

      Hi,

      I'm trying to run an optimization for a strategy. As I learned, I can do something like cerebro.optstrategy(MyStrategy, param1=param1_val_list, param2=param2_val_list, param3=param3_val_list).

      However, I don't want to run over every value on the value grid, but just a manually picked subsets. In this way the parameters are grouped like this:
      param_groups = [(param1_val, param2_val, param3_val), (param1_val, param2_val, param3_val), (param1_val, param2_val, param3_val), ...], so the value grid is irregular. Can someone suggest how to pass this list to the optimization engine? Thank you!

      vladisld 1 Reply Last reply Reply Quote 0
      • vladisld
        vladisld @jesseliu0 last edited by

        @jesseliu0 This topic was discussed few times on this forum ( try to search for optstrategy parameters ). Here some of the related posts:

        https://community.backtrader.com/topic/390/how-to-check-the-legality-of-parameters-before-running-the-test
        https://community.backtrader.com/topic/2227/optimization-sequence-multiple-combination-of-parameters
        https://community.backtrader.com/topic/2837/how-to-pass-a-list-of-dicts-to-optstrategy

        Not directly related but interesting nevertheless:

        https://community.backtrader.com/topic/186/genetic-optimization

        J 1 Reply Last reply Reply Quote 1
        • J
          jesseliu0 @vladisld last edited by

          @vladisld Thank you!

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