I want to filter x.EarningReports.BasicAverageShares > 100000
but converting to a number fail. What kind of result is giving?
----- Also is there a field to get the marketcap?
def CoarseSelectionFunction(self, coarse):
filtered_coarse = [x for x in coarse if x.HasFundamentalData and x.Volume > self.minVolume and x.Price > self.minPrice]
self.Debug(str(filtered_coarse[0].Symbol))
return [i.Symbol for i in filtered_coarse]
def FineSelectionFunction(self, fine):
'''
filtered_fine = [x for x in fine if (x.EarningReports.BasicAverageShares and not (x.EarningReports.BasicAverageShares is None) ) ]
filtered_fine2 = [x for x in filtered_fine if float( x.EarningReports.BasicAverageShares) > 100000 ]
self.Debug(str(len(filtered_fine2)))
return [i.Symbol for i in filtered_fine2]
Jing Wu
Some fundamental variables have different time periods. You should specify the period. For example,
x.EarningReports.BasicAverageShares.ThreeMonths > 100000
In terms of market cap, you could use BasicAverageShares and the current price data (by history request) to calculate the market cap. Here is an example
Jesús P.Nieto
Thanks Jing! . help me a lot.
Last question:
What is the difference between using ThreeMonths or oneMonth or any other period? I'm interested in getting the most recent update to the day running on the backtest
Jesús P.Nieto
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!