Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Dividend calculations fail for dividends larger than stock price

There's a data issue for CBS on January 3rd 2006. CBS closed at 25.5 on December 30, 2005 and paid a $41.56 dividend the next day. Backtesting just holding CBS during this period generates a loss of -60%.

I think the issue is the way that zipline calculates the dividend adjustment ratio which becomes negative if the dividend is larger than the stock price. I found this when I was ingesting data on my local machine and the ingest function said that the dividend ratio for CBS was negative and threw a warning.

Attached is the backtest which shows the bug.

1 response

It wasn't a dividend but a split between CBS and Viacom. However, there still shouldn't be a 60% loss.

https://www.cbsnews.com/news/cbs-viacom-formally-split/