Open Pirat83 opened 1 year ago
How to get rid of this error:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.conda/envs/bt-composite-strategies/lib/python3.11/site-packages/bt/backtest.py:28: in run
bkt.run()
../../../.conda/envs/bt-composite-strategies/lib/python3.11/site-packages/bt/backtest.py:253: in run
self.strategy.update(dt)
bt/core.py:732: in bt.core.StrategyBase.update
???
bt/core.py:856: in bt.core.StrategyBase.update
???
bt/core.py:2144: in bt.core.Strategy.run
???
bt/core.py:2140: in bt.core.Strategy.run
???
bt/core.py:2079: in bt.core.AlgoStack.__call__
???
../../../.conda/envs/bt-composite-strategies/lib/python3.11/site-packages/bt/algos.py:1809: in __call__
target.root.update(target.now)
bt/core.py:732: in bt.core.StrategyBase.update
???
bt/core.py:732: in bt.core.StrategyBase.update
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E AttributeError: 'Strategy' object has no attribute '_values'
bt/core.py:763: AttributeError
======================== 1 failed, 4 warnings in 2.36s =========================
Process finished with exit code 1
Thank you very much.
Seems like https://github.com/pmorissette/bt/issues/333 has similar issues.
BT composite strategies
This repository shows the effect of the issue https://github.com/pmorissette/bt/issues/415. For more details see the
test_interpreter.py
unit test or use the Jupyter notebookexample.ipynb
Simple buy and hold strategy:
We create a simple buy and hold strategy with the QQQ.
First level composite strategy
Second level composite strategy
We create a combined strategy containing to combined strategies and one asset.
bt/core.py:763: AttributeError
If you can contribute to the solution I would appreciate it very much.