bt
bt copied to clipboard
Error in algo stack branching example
Traceback (most recent call last): File "C:/btexamples/algos_example.py", line 26, in
s = bt.Strategy('strategy', branch_stack, ['spy', 'agg']) File "bt\core.py", line 2107, in bt.core.Strategy.init TypeError: 'AlgoStack' object is not iterable
Above error when running Branching and Control Flow example
When instantiating the Strategy, try passing the algos as a list (i.e. s = bt.Strategy('strategy', [branch_stack], ['spy', 'agg'])
instead of s = bt.Strategy('strategy', branch_stack, ['spy', 'agg'])
).