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