Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Dealing with CannotOrderDelistedAsset or Cash become NaN in research backtest

There's issues when I had run into:

CannotOrderDelistedAsset: Cannot order QCRH on 2013-04-24 20:00:00+00:00 as there is no last price for the security.  

Or even worse, I found that the account data (e.g.

{
    'cash': NaN,   #context.portfolio.cash  
    'leverage': NaN  #context.account.leverage  
}

This is due to a temporary NaN value getting back from get_pricing. Note that this is handled gracefully in IDE backtest, but in research it is handled in a relatively hidden.

Attached with my Notebook, for the work around, and if anybody have better way to handle this would love to here.

Thanks!
boris