Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
curious phenomenon: an unknown stock is mixed in my portfolio

Today by backtesting I find a very curious thing: In my algo I just have the stock MDLZ. But from a date another stock KRFT is mixed in the portfolio. See my attached backtesting. I doubt if it has a little to do with the black hole? :-/

Formerly I have sometime quite mysterious error by backtesting. But I fail to find out the reason. Today I catch it.

8 responses

Such a problem doesn't just happen to MDLZ, but also to some others.

One can see at the beginning there is only one stock MDLZ in the portfolio:
... 2012-08-20 21:59 PRINT Stock:Equity(22802 [MDLZ])
2012-08-21 21:59 PRINT Stock:Equity(22802 [MDLZ])
2012-08-22 21:59 PRINT Stock:Equity(22802 [MDLZ])
...

But from 2012-10-02, another unknown stock 'KRFT' is mixed in my portfolio. Terrible. :-)
... 2012-10-02 21:59 PRINT Stock:Equity(22802 [MDLZ])
2012-10-02 21:59 PRINT Stock:Equity(43405 [KRFT])
2012-10-03 21:59 PRINT Stock:Equity(22802 [MDLZ])
2012-10-03 21:59 PRINT Stock:Equity(43405 [KRFT])
2012-10-04 21:59 PRINT Stock:Equity(22802 [MDLZ])
2012-10-04 21:59 PRINT Stock:Equity(43405 [KRFT])

In 2012 there was a Mondelez/Kraft spin-off
See here

@Albert,

Thanks for the information. Do you know where can one find the general spin-off information? I think maybe there is spin-off not only by MDLZ but also by some others.

Besides, such spin-off will influence or even distroy the result of my algo. I wonder how to detect such spin-off when I run the backtesting, especially when I do live trade?

Thomas

I update my algo: as soon as the spin-off happens, I will sell it. One can see the RETURN is different than I haven't sold it.

I find this phenomenon occacionally. It seems I have backtesting all of my algos again under considering the spin-off.

backtesting

Yeah sure, you can subscribe to the spin-off datafeed:
https://www.quantopian.com/data/eventvestor/spin_offs
There is also one for M&A, which you probably also want to consider!
https://www.quantopian.com/data/eventvestor/mergers_and_acquisitions

Many thanks!