Back to Community
"period_ending_date" and historical fundamental data (quarterly/yearly)

What is the difference between the "period_ending_date" in the "Earnings Report" anf that one in the "Financial Statement Filing".

Data like "total_revenue" or "net_income" are annually or quarterly?

What is the most simple way to get the fundamental data for example for the previous 4 quarters or years?

Thanks!

17 responses

Hi Costantino,

Unfortunately there isn't yet a simple built in way to store or access previous quarter's metrics for the fundamental data right now. This is definitely on our roadmap with fundamentals (and is something I'm actively researching to make sure we have the right use cases covered). Something like the history() function, but for fundamentals is what you're probably looking for. Seong in a previous thread provided a workaround: https://www.quantopian.com/posts/referencing-fundamental-data-of-previous-period

If you don't mind sharing, I'd love to understand exactly what kind of data you were hoping to get. I can make guesses on what folks would want here but more detailed, real-life examples are always way more helpful! Feel free to share here in the thread, message me or send me an email at [email protected]

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.

Hi Josh,

I've startet to port to Quantopian the algorithm outlined by Wesley Gray and Tobias Carlisle in their book "Quantitative Value" (Wiley 2012).
Therefore I need 8 years of historical fundamental data and the last four quarter of quarterly data.
I glad to hear, that this feature is definitely on your roadmap.
I've already started to use the approach used by Seong (Pandas Panels) and let you know how I will implement my solution.

Thanks
Costantino

I've ported a lot of the "Quantitative Value" calculations into screener.co. It was rather painful to say the least. As Costantino says, there are some rolling average and stdev calculations that are done on 8 years of gross margin. Also needed are 8 years of ROA. There are quite a few other calculations involved but just change on year data would cover quite a few of them. Will be keeping an eye out for these developments as it would be good to use them in Quantopian for future screening.

I just ran into the same problem trying to calculate ev_to_ebitda myself and had started a thread why ev_to_ebitda and calculated ev_to_ebitda didn't matchup.
Which is when i realized the ebitda was quarterly and not annual and ended up asking the same question as this thread.

https://www.quantopian.com/posts/ev-to-ebitda-vs-calculated-ev-to-ebitda-differs-why

The best way to look at the history of fundamental data fields.

My use case.
0. I tend to do the following before_trading_start() every day/month/quarter/year
Building my own indexes
1. Since I don't have access the S&P 500 components, I am building my own index of stocks based on some market valuation and fundamental criteria and sector distribution
2. I update this components and weighting of my index every month or quarter or year( still figuring this out)
3. I calculate the value of the index every day.
4. I would also calculate the various fundamental fields for this index, such as marketcap, enterprise_value, ebit, ebitda, ev_to_ebitda, etc for this index as well.
5. I don't have access to price data when doing this under before_trading_start if I also want filter based on price or price history, mostly to avoid penny stocks. I ran into a problem where a market cap > 100e6, ..... filter brought me a 0.5 cent stock into my portfolio or index.

  1. One of the fundamental examples uses a fundamental query to set my universe of stocks. But how can I eliminated penny stocks from this universe. Today I se the universe in before_trading_start, where I do a fundamental query to arrive at a list, but cant filter out penny stocks without having price/historical pricing(to say look at average price over the last couple of months) data to set my stock universe.

Thanks,
Sarvi

Sarvi,

I think I've seen examples of accessing price information in the fundamentals function, but at worst, you could filter out penny stocks when re-balancing, before buying.

At the moment it's quite painful to get annually or TTM (Trailing Twelve Months) fundamental data with the Quantopian API.

An easy way to do this, would by introducing a suffix, for example:

query(  
    fundamentals.income_statement.net_income,  
    fundamentals.income_statement.net_income_yr,  
    fundamentals.income_statement.net_income_ttm  
)

where
- net_income would be the net income for the last quarter (as it is now),
- net_income_yr the net income reported in the most recent annual report
- net_income_ttm the sum of the net income reported in the last four quarters.

I would be very glad, if you could address this problem.

Constantino,

This is definitely on our roadmap. We're researching solutions currently and starting our design work on this type of feature. We want to provide access to longer time frames of data both in the backtesting and trading scenarios as well as our research environment.

Your ideas here are very helpful. Any and all examples of real life usage help us best design the solutions.

Thanks
Josh

It would be helpful to not only
1 calculate new fundamental fields based on trailing fundamental data
2 calculate new fundamental fields and technical fields based on both fundamental history as well as price history. Say macd, ma, enterprise value
3 allow for these calculated fields to be queried on to filter stocks
4 to have calculated fields be available as additional columns in the data pandas object available in handle data function

Sarvi

By the way, as I reported also in this post, currently the 5 years average ratios like avg5_yrs_roic, gross_profit_annual5_yr_growth and roa5_yr return always None.
Could you please take a look to this problem?

Thanks!
Costantino

Constantino,

Definitely looking into that problem. The ROIC and ROA metrics aren't making it into our DB for some reason. I need to dig in to see whether that's on our end or Morningstar's. There's something different going on with the gross profit metric (there's data in the db, it might be old data). We're on it.

Thanks
Josh

Hi Josh,
When providing access to fundamental data, there is a thread talking about API changes to have access to fundamental history to calculate 3 or 5 or 10 year averages of EBIT or EBITDA ourselves.
I understand that quantopian allows back testing only from 2002.
But it would still be very helpful to have access to fundamental history data as far back as morningstar can provide for the stocks we are working at the beginning of the back test.

Thanks,
Sarvi

Did this ever get implemented? I'm interesting in comparing revenue, EBITA, and Earnings data over a QoQ and YoY basis.

Bumping this thread to see if the yearly data was ever implemented...

Interested in if this was implemented as well

I am interested in improved fundamentals as well. Here are my current requests:

  1. net_assets currently gives me NaNs for the Q500US.
  2. Improved speed for accessing fundamental data in a backtest.
  3. The ability to access five years worth of data or a snapshot from five years back.
  4. "Clean" access to yearly, quarterly data.

Am looking for trailing twelve months earnings data.

Haven't seen a more relevant post on the subject, and it has been 2 years since a Quantopian reply to this thread.

Is there somewhere else we should be looking? Might be worth a link here, as this post has a few good keywords and am guessing others are getting here via Google.

Thanks

Hi Jordan,

It looks like you emailed in privately and were pointed to a solution in another thread. You have a good point about the keywords in this thread, so I'm going to paste it here for convenience. This is a good approximation of TTM pipeline factors by Costantino.

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.