For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

optimizing single param across portfolio.

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

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

  • administrators

    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.

Log in to reply