In the attached backtest I'm emitting insights as part of a pairs strategy. The code is emitting Up and Down insights as expected, and then going long or short accordingly. Then I have a risk management module that liquidates positions once a certain drawdown threshold is reached. 

The problem I'm seeing is that new orders are being created after a position is liquidated, in the absence of any new insights being generated. These new orders happen daily at 3pm (I'm also confused why it happens on this schedule).

I suspect the problem is that even though a position has been liquidated for a given security, there is still an insight associated with that security. I have the insight expiration set to something arbitrarily long for this strategy (30 days), since I don't actually want insight expiration to when a position gets closed. I want a position to close when the risk management module says to, and only enter a new position once there are new insights emitted.

Am I understanding this correctly? I suppose one solution would be to somehow cancel a security's insight after it's liquidated? How can I do this?

Thanks!