Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to know if an equity will be removed from the market?

I realized that some equities are removed from the market, for example:

>>> symbols('MFE')  
Equity(26434, symbol=u'MFE', asset_name=u'MCAFEE  INC.', exchange=u'NEW YORK STOCK EXCHANGE', start_date=u'Mon, 04 Jan 1993 00:00:00 GMT', end_date=u'Mon, 28 Feb 2011 00:00:00 GMT', first_traded=None)  

Is there a way to know that the equity will be ended in the near future, so I can close all positions in that equity before it is ended? In the backtest, the end_date for MFE is always 28 Feb 2011, but how to know this in real time trading?
I tried to check that the symbol's end_date is today, but right at this moment the end_date is 11 Sep 2015 for AAPL and now it is 12 Sep 2015 in UTC timezone, so it does not seem to work. Is it because the servers are in the US so a few hours behind UTC? This is how I calculated "today":
today = datetime.datetime.utcnow().date()

The attached code prints:
2015-09-08 handle_data:8 INFO end_date: 2015-09-11 00:00:00+00:00, today: 2015-09-12

Thanks for any reply.

2 responses

Andras,

As far as I know, there is no way to manage expirations under live trading, unless you do it manually. There is no data set available from Quantopian that will provide the "heads-up" to remove the security from your trading universe.

Grant

Thanks, Grant. It is bad news. I guess this is a common need for all live traders, so it would be nice to have it included into Quantopian.