Hello there,

I am trying to develop a custom Risk Management decision tree so that when a condition is met, I close the position and remove the underlying from the portfolio (otherwise, OnData Loops back on it and I want to avoid this).

However as you can see in the attached backtesting, the securities are not removed, even when I loop through each component of the portfolio to force removing everything - underlying equities remain there in the portfolio... Have you guys ever witnessed this behavior? Is there another way to do this ? It seems to be working when I'm resetting the portfolio every night so I tend to think that there is a problem with intra-day behavior...

Thanks in advance for your help,

Terence.

 

 

Author