Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Debugging anomalous dividends?

Does anyone know of a systematic way to debug anomalous dividends? I have this huge cash deposit on October 31st, 2007, but it could be due to any one of 200 stocks, and I don't want to try to drop them one at a time to find out which one paid the dividend. Is there any way to log dividends or something like that?

14 responses

If you do a formal backtest will it show the data there?

I am not sure what you mean ?

Can you do a formal backtest, and take a look at the securities on that day or around there and see which one might be volunteering the extra cash. Is there any indication as to what might cause the boost: huge drop in price that's not caught by Q's exdividend adjustments? Or a buy out? Or something in price or activity that would indicate some clues?

Oh yeah I mean I guess I could do all of that, I was hoping there was a way to log the dividends paid and which stock paid them :)

Unfortunately I don't think we provide an easy way to figure that out. That's a problem.

One would hope you'd see a corresponding drop in the value of one of your holdings a few days beforehand, by looking at the positions in the full backtest screen. But if it's anomalous, then it might be a bug, and then even that won't solve it.

Perhaps you can share the backtest? Or email us the list of securities you're holding at support?

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

I feel like you should be able to get this using the get_backtest function in research....

Another user was looking into something similar (https://www.quantopian.com/posts/anomalous-appearance-of-cash-during-backtest) and I suggested research to him as well. I started looking into it, but got distracted. Perhaps he figured something out and can help.

** I just realized I was suggesting the same thing as Market Tech just through research.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Yeah, but it would still be a chore to try to map the cash flow to the stock, wouldn't it? Cash flows are not tagged with source or reason or anything, as far as I know?

I can confirm that the issues in the thread referenced by @Karen (https://www.quantopian.com/posts/anomalous-appearance-of-cash-during-backtest) are also due to weird dividends.

Perhaps it's a systemic issue/bug, and they can fix them all in one fell swoop? If there are a few big ones that show up visually, there's probably hundreds or thousands that we are not noticing...

In the investigations I've done so far, it's all one-offs, not a systemic issue. The last systemic issue of this nature was the one related to splits and dividends - it is fixed.

These one-off data bugs are a pain. It's the cost of doing business in finance - the data is always a little dirty, and you have to buy from a good vendor, and it's still not perfect. Doesn't mean I like it, though.

In my experience, the bugs like this tend to be found when people are using big trading universes, like from DollarVolumeUniverse and fundamentals. People stop looking at the AMZN and TSLA of the world and start scanning hundreds of stocks per backtest. The bad data examples start sticking up like that nail you stub your toe on out on the porch. The latest round of data bugs is, I think, a healthy by-product of the recent product advances.

(I haven't finished the investigations of 2-3 recent requests, and if I do find something systemic, I'll be sure to report back).

So, after a couple of hours of tedious digging through the backtest in reseach, I narrowed it down to one of the following stocks. This particular event happens between Oct 30th, 2007 and Oct 31st, 2007.

sid  
24105    PALM  
25392    AMED  
20928    SNWL  
22918    MDTH  
8644     GYMB  
21266    GTIV  
10268    SCHN  
7148     STFC  
7918      RVI  
33604     FSR  
7728     UFCS  
28049    SMOD  
20284     SKX  
23709    NFLX  
8306      WOR  
11361    PENN  
17988     CBZ  
33239     EIG  
23687     GTI  
19909    MKSI  
3950      INT  
11710     GEO  
26350     PRX  
27529    UEPS  
8516      ELS  
7367      TDY  
19185     AKR  
405      AMWD  
6925     SKYW  
26439     VVI  
6489      RLI  
1703      CNL  
12615     TRK  
5413       NR  
2105     ASNA  
6018     PLAB  
4803      MEI  
11999    AZPN  
26410     BEE  
6897     SIVB  
20539    QSFT  
23499    EPAX  
987       BNE  
209        AM  
32121    KALU  
8166      WGL  
8288      WSO  
25806    GBLI  
6624     SAFM  
21736     CBK  
4435       LG  
523       AAN  
24489    GLNG  
1833      CQB  
4621      LZB  
5621      OHI  
26781    MKTX  
21754    ENTG  
23019    OMCL  
1103      BRY  

What's the scoop on narrowing this down? For reference, it's a cash flow about 30x larger than the value of any of these positions...

Correction: It doesn't seem to be one of those after all. I need to rerun some backtests to make sure it's still happening...

Not sure if it helps you but 523 AAN is NaN on 2007-10-29 and 2007-10-30 (yahoo says it didn't trade on those dates either)

Yeah I mailed my results to Dan, it doesn't seem possible, or at least easy, to diagnose these problems without some sort of record of where a cash-flow came from, which I presume they can extract using internal logging.