Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
run backtest on two portfolios in parallel to manage one according to the other's NAV

Hi all,
I am trying to perform a backtest in zipline/quantopian so that my strategy stops investing or deleverage if it makes a given loss and re invests when it would have recovered -if invested- from that loss. It would be helpful to have a portfolio traded continuously everytime in order to see the recovery and another one invested only when meeting the recovery position based on the former portfolio. I don't see an easy way do that. My current walkaround is to invest very little money when I would like the strategy to be off but it is not very nice.
Would anyone have an idea on how to do that nicely?

Many thanks,
Vincent

2 responses

Hey Vincent,

The system is not built to handle multiple backtests, but you can perhaps write your own functions in the IDE to track the cumulative return for each of the sub-portfolios for each strategy. The asset weightings from each of the sub-strategies can be combined to form your overall portfolio which will be executed using the IDE.

Best,
Ryan

Hi Ryan,
Thanks for your response. I'll track the cumulative return myself.
Best Vincent