Back to Community
Getting dates for Delisted and IPO's of Stocks

Hi,
I would like to analyze a large group of stocks. I want to know the end dates and the start dates for every company, then I can calculate the percent change of every company, and analyze them. When a company is first has data to the last day the stock has data. How do I go about doing this?

Like for example if Lehman brother's IPO was in 2002, and the delist date was sometime in 2008. What was the difference in price from where they started and where they ended? I will not have data for every IPO since it might have been actively trading before the start date.

Thanks,

Eric

This is how I got some weird number for days since IPO. I tried to adjust to seconds but it did not give the right number.

class StockAge(CustomFactor):
inputs = [morningstar.share_class_reference.ipo_date]
window_length = 1

def compute(self, today, assets, out, ipo_date):  
    delta = ipo_date[0]  
    out[:] = delta  
3 responses

Can you tell me more about what you're trying to do? Is this an investment strategy, or a research project? As an investment strategy, keep in mind that you generally can't know the delisted date until after it happens. So, you can calculate the returns-to-date for anything, but you can't calculate returns-to-delisting until it's too late. Not to mention: most of the time, the returns-to-delisting are close to -100%. . . .

You might look at the asset object. It has the data that you're looking for. But, you really need to be careful. You're walking down a path that usually leads directly to data-snooping and overfitting.

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'm just trying to do some research. I want to know the price of the stocks at the Start Date and then the End Date, and then compare the percent returns over the time period of when the stock was active. I think the asset object is a good place to start. I'm just looking to make a histogram in deciles of the percent return.

Here is what I was trying to do. It shows most stock in their lifetime either perform really well 300%+ or really bad with -75% to -100% returns. There are a lot that perform around 0%. It takes a while to run.

Loading notebook preview...
Notebook previews are currently unavailable.