Hey, I am trying to access the EarningReports.FileDate so I can check if the the day before was an earning report for a stock, under FineSelection. This is my code:
def FineFilter(self, coarseUniverse):
yesterday = self.Time - timedelta(days=1)
fineUniverse = [asset.Symbol for asset in coarseUniverse if asset.EarningReports.FileDate == yesterday and asset.MarketCap > 1e9]
tickerSymbolValuesOnly = [symbol.Value for symbol in fineUniverse]
return fineUniverse
I tried to Debug many times and I still can't figure out why it is not returning anything. Plus, it is working for the tutorial that I am following.
Note: CoarseUniverse is returning the stock objects so it is working. The filter asset.MarketCap >1e9 is working as well.
I have tried several other filters such as: asset.ValuationRatios.PERatio < 100, and everything works. It is just asset.EarningReports.FileDate == yesterday that is not working.
Mia Alissi
The
EarningReports.FileDate
property in QuantConnect provides the date of the last 10-Q report filing, not the upcoming one. This means it's not possible to filter stocks based on an upcoming earnings report date. However, you can select stocks that have recently released their 10-Q report.Here is an example of how you can filter stocks that have released their 10-Q report within the last 7 days:
In this code,
x.EarningReports.FileDate + timedelta(days=7)
checks if the current time is more than 7 days after the earnings report file date. If it is, the stock is included in the fine universe.Please note that the
EarningReports.FileDate
property is sourced directly from Morningstar, who mark the Earnings Report File Date once a company files its 10-Q (the official quarterly report) with the SEC. Companies often file an 8-K report (whose purpose is to announce major corporate events that affect shareholders) prior to their 10-Q, and the 8-K report often includes Financial Statements, including information such as EPS. Morningstar sources its earnings information from the 10-Q report and so it will likely be dated differently from earnings information derived from other sources, such as NASDAQ. The 10-Q, however, is the more comprehensive report and it helps provide us with such an extensive Fundamental Data library.Sources:
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.
Yassin Khanji
It is still not working as it says that x.EarningReports.FileDate is not a datetime object
Carlos
Hey,
I had the same problem, since yesterday is a datetime object, you need another datetime object to compare it with yesterday, you have to use x.EarningReports.FileDate.Value in order to obtain the datetime object of the most recent earnings filing.
Yassin Khanji
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!