Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Backtest: What happens to an acquired company?

In my trading algorithm, I'm putting considerable effort into ensuring my cash level doesn't go negative. I want to set up a strictly long, unleveraged trading situation. So given this, I'm wondering how I should handle the acquisition of a company that I have bought in a backtest.

The specific question I have is about Sunoco (SUN), which according to this article was acquired in a cash+stock deal in 2012:

http://dealbook.nytimes.com/2012/04/30/energy-transfer-to-buy-sunoco-for-5-3-billion/

This was a cash+stock deal. So after the deal goes through, I would expect to:

  1. Have no position in SUN
  2. Have a new position in energy transfer partners (ETP)

But, I have the following position in my context. I can't figure out if a cash value equivalent to this now untradable position was added to my account.

Position({'amount': 85, 'last_sale_price': 46.8, 'cost_basis': 47.33311765969047, 'sid': Equity(7211, symbol=u'SUN', asset_name=u'SUNOCO INC', exchange=u'NEW YORK STOCK EXCHANGE', start_date=Timestamp('1993-01-04 00:00:00+0000', tz='UTC'), end_date=Timestamp('2012-10-04 00:00:00+0000', tz='UTC'), first_traded=None, auto_close_date=None)})  

So far as I can tell, I didn't see a new position for ETP in my portfolio. Nor did I see a cash deposit corresponding to the SUN acquisition. Which means that my backtest showed performance worse than I would otherwise expect.

If anyone has further information to offer on this matter, I would really appreciate it.

Thanks,

Sunil

2 responses

I am not sure how well the backtester handles M&A. In the past, for stocks which are going to be delisted, the recommendation has been to check the end_date of the sid, and if it's coming up, pre-emptively sell it a few days prior. Clearly that won't be possible in live-trading, but hopefully if the algo can handle unexpected positions (by selling them, for instance), live trading won't be a disaster.

Far from ideal as it doesn't handle stock-for-stock deals, but at least I won't be stuck with a position that I can't do anything with... I'll take your suggestion in place of the much hackier code I now have in place.

Thanks,

Sunil