UPDATE: SOLVED @backtrader could you please delete this post?
Need help from python experts with strategy parameters.
I have a strategy defined as:
class MyStrategy(bt.Strategy):
params = (('param1', None), ('param2', None), ('param3', None), )
def __init(self)___:
....
def next(self):
....
Also I have function defined for single backtest with strategy_params argument as list:
def single_backtest(strategy_params):
cerebro = bt.Cerebro()
cerebro.addstrategy(MasterStrategy, ?????)
cerebro.adddata(data)
strats = cerebro.run()
return cerebro
And function call for single backtest as follows:
if __name__ == '__main__':
single_run_params = [10, 10, 10]
cerebro = single_backtest(single_run_params)
How this strategy_params list can be transformed (if necessary) and passed to .addstrategy() method? So in the future I just add/remove parameters in the strategy and change list in the main.