Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to get the historical fundamental datas?

We know we can get the historial price data by using the function history(...). But how to get the historical fundamental data (ie. pe, pb etc.) of as stock?

And normally what is the period update of such fundamental datas? Monthly? Quataly or even annually?

Cheers

Thomas

6 responses

You can access longer time series' worth of fundamental data in an algorithm through the pipeline API: https://www.quantopian.com/help/#fundamental-data

For data since the advent of our subscription to Morningstar, the data provided through the API is either quarterly or more frequent than quarterly (typically daily). Metrics like revenue are updated quarterly with new filings. Metrics like market cap update daily. We don't yet make available annual or TTM metrics through the API.

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.

Many thanks!

I have a couple of questions regarding the historical fundamental data and was wondering if you can help me:

  1. Based on the aforementioned information and after playing a bit in the pipeline API, my understanding is that income statement and cash flow statement items (like net income or revenues) are taken from the quarterly fillings. Is there any quick way to calculate TTM data in the pipeline API or the only possibility would be to play with the asof_date BoundColumn and build some logic for summing last four quarters?

  2. Also, what is the most efficient way of retrieving say last 8 quarters of net income data? While the window length logic in the Custom Factors works great for items that change on a daily basis (like Price) it seems rather inefficient to use the same if you are interested in getting quarterly financial statement data (since most of this time-series will be repeated)?

Thanks,
Greg

@ Grzegorz Ledwon

There's no 'quick' way to get TTM data. One must check the 'as_of' date. Maybe look at these two posts for some ideas.

https://www.quantopian.com/posts/eps-ttm
https://www.quantopian.com/posts/trailing-twelve-months-ttm-with-as-of-date

The latter post has some code which you could copy and paste (thank you Doug Baldwin).

Good luck

@ Grzegorz Ledwon

The trailing-twelve-months-ttm-with-as-of-date notebook can be edited for 24 months - increase the window to something over 504 (=2*252, say 600 should be good) and double the timedelta in the formula.

Also, see comments and my notebooks at these two posts regarding date and data quality issues:
https://www.quantopian.com/posts/fundamentals-updating-daily-vs-monthly-or-quarterly
https://www.quantopian.com/posts/upcoming-changes-to-morningstar-fundamental-data

@ Dan/Doug

Many thanks for your replies, this is extremely useful!