Still trying to reach previous earnings dates for backtesting purposes. I see under the Data tab on your header bar, there is Fundamentals data (for the United States) that is provided by Morningstar. On that page, I see an EarningReports group, with FileDate as an option. How do I reference this???? Does it come in with
AddSecurity(SecurityType.Equity, symbol, Resolution.Daily);
If so, how do I reference it? Securities["symbol"].EarningReport.FileDate
Crissi Wells
For debugging purposes, how would i log (or display) the next earnings date? The following gives error messages. I'm sure I'm not defining or accessing it correctly.
Debug("The next earnings date is " + Securities["symbol"].EarningReport.FileDate)
Alexandre Catarino
In QuantConnect/Lean, we deal with different types of data.
Securities[Symbol] is a Security object. It does not have fundamental information.
The objects that have fundamental information can only be accessed with a method that as argument of the AddUniverse:
// In Initialize: AddUniverse(CoarseSelectionFunction, FineSelectionFunction);
In this case, the FineSelectionFunction method. There we can loop thought the fine enumerable and display the earnings date:
public IEnumerable<Symbol> FineSelectionFunction( IEnumerable<FineFundamental> fine) { foreach (var x in fine) { Debug("The earnings were filed on " + x.EarningReport.FileDate); } return fine .OrderByDescending(x => x.ValuationRatios.PERatio) .Take(NumberOfSymbolsFine) .Select(x => x.Symbol); }
Alexandre Catarino
Let me add that we agree it should have access like that, since some strategies do need/use fundamental outside the scope of universe selection.
We've added this feature to our TODO list. ;-)
Crissi Wells
Thanks (again) Alexandre! I'm a veteran trader, but new to C#. I appreciate the extended explanation! I feel like a kid in a candy store with these backtesting opportunities!
Liquidgenius
Hi, in terms of the earnings report filing dates, I noticed your code uses past tense...
Debug("The earnings were filed on " + x.EarningReport.FileDate)
Are future file dates also included in the Morningstar data, and if so how far ahead? At minimum I am just looking to access the next date for any particular asset. Thanks in advance! @Alexandre Catarino
Tim De Lise
Alexandre Catarino is there a reference document that lists all of the fundamental data available? I can't seem to find one for QuantConnect?
Jared Broad
Its in the data link in the page header under fundamentals.
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.
Tim De Lise
OK I found it, here it is: QuantConnect Morningstar Fundamentals Reference
Goofball
Alexandre,
I wanted to check in on the feature on your TO DO list i.e. making the fundamental data accessible outside the universe selection so that it can be used in strategies as well. Has that feature already been added or will it be released in the near future?Â
I am particularly looking to have access to the industry data for the symbols in my universe.
Shile Wen
Hi Goofball,
We now receive fundamental data in the Security object if we have a Fundamentals based Universes. For a basic example, please see the attached backtest. Furthermore, documentation is currently being fleshed out for this new feature.
Best,
Shile Wen
Goofball
Thanks Shile. This is a super useful feature!
Steve Goswell
Hi Shile,
When I clone and run the algo you posted I get this runtime error.
Any ideas?
Â
Fred Painchaud
Hi Steve,
If I may while I'm at it. Little bugs in the data it appears (some are flagged to have Fundamentals but they don't):
You will need to handle None possibly returned by MarketCap and Rev when you call them. In the current algo, only Rev is called and it is only to log it so then, None, is fine.
Fred
Crissi Wells
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!