Up until last week, I was able to use QuantBook (specifically, qb.GetFundamental) in the backtester to get historical fundamental data. With a bit of work, I was able to get everything I needed (like TTM data) using a method similar to this.
However, this no longer works. In the docs it says “GetFundamental in research does not have any counterpart in backtesting". Since GetFundamental worked last week in backtesting, I imagine this has to be a recent change.
Three questions:
- Will we get a built-in TTM or historical fundamental option? It has been asked for since 2016: here, here, here, here, and more. There's a GitHub issue for it with even more people asking for the feature, but no apparent progress. I get QC staff is busy but this seems like something that is always being requested.
- In the meantime, can GetFundamental be returned to the backtester? It was a perfect stop-gap solution. Given the amount of times this has been asked for (like Karthik Kailash's post) there's at least a few of us who were using it
- If neither #1 nor #2, how else can we get TTM values, or historical fundamentals?
I really think it's in QC's best interest to get this feature going. Most quantamental investors can't use QC right now without more granularity on the fundamental side. The .TwelveMonths time span gives the annual report which is often far too outdated to use. Any help from staff is appreciated here.
Fishstoryyy
I also agree this is a great feature to have, or a must-have for fundamental investors. Personally I want this feature in order to train machine learning models in the backtester with historical fundamentals. Hopefully staff members can see this post.
Big mak
I agree, it's a must-have for fundamental investors. QC already has this data, it just needs to be made accessible. And up until last week, it was,
I was able to get TTM data for 2000+ stocks somewhat efficiently by grabbing the fundamental at a set interval. With a few added filters, my TTM values lined up perfectly with 10K/10Q statements. This method could be extended to any historical length, not just TTM.
I'd be happy to work with the staff to get this implemented at-large for all QC users, since I ironed out a lot of the errors that popped up along the way.
Big mak
Weirdly enough qb.GetFundamental is working again, which is great.
The first question still stands though. There are relatively easy ways to create a wrapper around GetFundamental to avoid lookahead bias and to speed up the process…but being able to call Morningstar's TTM data directly should be an order of magnitude faster.
Louis Szeto
Hi Big mak
We suggest using our alternative dataset of SEC filing data. 8K, 10K and 10Q data (including fundamentals) can be accessed in it. You may use history method to access it as dataframe. Please refer to this link on its application. You can easily create valuation metrics using that and pricing data.
In another way, you may also create rolling windows collection and update the valuation ratio metric when passing fine universe selection daily, but this method might take a long warm-up period.
Best,
Louis Szeto
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Cool nemo
@Louis Szeto
10Q data (including fundamentals) get fundamentals field from text, can replace with struct data field?
Louis Szeto
Hi Cool nemo
We're sorry that the dataset is raw data directly fetched from SEC website reports. The data is only available in text/XML format. We suggest you could use a web-scraping library like bs4 to scrap the required field.
Best
Louis Szeto
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Big mak
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!