Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Why does the data in handle_data have different dates for some securities?

I was under the impression that handle_data was a single slice in time. Whether it was a day or a minute but when I run this test, I can see that output is logged.

Is my test somehow wrong? Is my assumption about handle_data wrong?

Someone please help me.

6 responses

In general, the date should be the same for a given slice.

I cloned your algo and looked at the first few dozen errors. They all were related to Bear Stearns (BSC) which stopped trading in 2008. What I can't figure out right now is why that stock is still in your set_universe() - that feels like an error. I'm going to dig deeper tomorrow.

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.

Thanks for responding Dan.

When you say in general, what are some examples of times that the date should be different?

Dan, did you ever find more information around this?

Hello Charlie,

Like you I was puzzled by Dan's reply. Coincidentally, I think fawce posted the answer here earlier today. I have never heard of this forward fill (of price, date, and volume) until today. Or if I have I can't remember.

P.

Oh ok. Thanks for linking to that thread. That explains it perfectly!

Hi Peter,

Yeah, Fawce's revelation was news to me, too. I looked over the documentation and couldn't find any mention of it...kind of a big deal to leave out (unless somehow I missed it).

Grant