Hi guys,

Here is what I'm hoping to do:

  • If portfolio drawdown from start of day is below a threshold set all holdings to 0
  • Also don't enter into any new transactions for the rest of the day
I could do the portfolio drawdown check in a RiskManagementModel, the problem is that I need a way to clear all the ActiveInsights so that the algorithm does not make additional transactions based on them.  I can't emit insights in the risk model because the RiskModel is executed inside the ProcessInsights loop and EmitInsights would kick off another ProcessInsights loop.

So I decided to do it in my alpha model and check for drawdown as a first step in the Update process. I set the Insights to flat and the Portfolio Target to 0 on the holding.  This does not work though.  Setting the portfolio target does nothing because it will be overwritten by the targets created from the Insights.  However the targets created from the flat insights do not cause the sale of the holdings.

It seems at this point the only way to implement this will be with a custom PortfolioConstructionModel.  Any recommendation or suggestions would be welcomed.

Author