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/

    OptStrategy dynamic parameters with range

    General Discussion
    1
    1
    4
    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.
    • Nektarios Sfiris
      Nektarios Sfiris last edited by

      Hello,

      I have found how to pass dynamic parameters to optstrategy (as discussed also in another post) like below:

      d = {'period': [14, 16, 20 , 22, 25, 30], 'period2': [33, 39]}
      cerebro.optstrategy(MyHolyGrailStrategy, *[], **d)
      

      This way though, for period2, it only goes through values 33 and 39. What i was trying to find out is a way to pass a range of params though, like below:

      strat = cerebro.optstrategy(TestStrategy.TestStrategy, maperiod=range(10, 31))
      

      Any ideas?

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