Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to construct a grandparent-parent-child structure. #333

Open
hermian opened this issue Oct 14, 2021 · 0 comments
Open

I want to construct a grandparent-parent-child structure. #333

hermian opened this issue Oct 14, 2021 · 0 comments
Labels

Comments

@hermian
Copy link

hermian commented Oct 14, 2021

Hello.

Can't we construct another strategy on top of the strategy's strategy? I want to construct a grandparent-parent-child structure.

If the example(Strategy_Combination.ipynb) is modified and executed, the following error occurs.

AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_2097621/4242092674.py in <module>
      6 )
      7 
----> 8 res = bt.run(combined_test)

~/venv/algo/lib/python3.8/site-packages/bt/backtest.py in run(*backtests)
     26     # run each backtest
     27     for bkt in backtests:
---> 28         bkt.run()
     29 
     30     return Result(*backtests)

~/venv/algo/lib/python3.8/site-packages/bt/backtest.py in run(self)
    252 
    253             # update strategy
--> 254             self.strategy.update(dt)
    255 
    256             if not self.strategy.bankrupt:

~/venv/algo/lib/python3.8/site-packages/bt/core.cpython-38-x86_64-linux-gnu.so in bt.core.StrategyBase.update()

~/venv/algo/lib/python3.8/site-packages/bt/core.cpython-38-x86_64-linux-gnu.so in bt.core.StrategyBase.update()

~/venv/algo/lib/python3.8/site-packages/bt/core.cpython-38-x86_64-linux-gnu.so in bt.core.Strategy.run()

~/venv/algo/lib/python3.8/site-packages/bt/core.cpython-38-x86_64-linux-gnu.so in bt.core.Strategy.run()

~/venv/algo/lib/python3.8/site-packages/bt/core.cpython-38-x86_64-linux-gnu.so in bt.core.AlgoStack.__call__()

~/venv/algo/lib/python3.8/site-packages/bt/algos.py in __call__(self, target)
   1813 
   1814         # Now update
-> 1815         target.root.update(target.now)
   1816 
   1817         return True

~/venv/algo/lib/python3.8/site-packages/bt/core.cpython-38-x86_64-linux-gnu.so in bt.core.StrategyBase.update()

~/venv/algo/lib/python3.8/site-packages/bt/core.cpython-38-x86_64-linux-gnu.so in bt.core.StrategyBase.update()

~/venv/algo/lib/python3.8/site-packages/bt/core.cpython-38-x86_64-linux-gnu.so in bt.core.StrategyBase.update()

AttributeError: 'Strategy' object has no attribute '_values'

Anyone who has tried, please help.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants