Back

ForwardPERatio is always 0

Here is my FineFilter function:

def FineFilter(self, fine):
        if self.Time.month == self.lastMonth:
            return self.symbols
        self.lastMonth = self.Time.month
        for x in fine:
            self.Debug(str(x.ValuationRatios.ForwardPERatio))
        fine = [x for x in fine if x.ValuationRatios.ForwardPERatio > 0]
        fine = sorted(fine, key=lambda x: x.ValuationRatios.ForwardPERatio, reverse=False)
        self.symbols = [x.Symbol for x in fine[:50]]
        return self.symbols

When I debug, all of the ForwardPERatio is always 0. What am I doing wrong?

Update Backtest







0

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.


Hi Michael,

It's difficult to debug why your issue is arising without seeing the rest of your code.  Please attach the rest of your code so that we can better understand your issue.  I attached a working example where the ForwardPERatio is non-zero.

Best
Rahul

1

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.


Here is a backtest demonstrating the lack of ForwardPERatios

0


Hi Michael Boguslaw ,

If you change the algorithm end date, you will see that we have ForwardPERatios starting in September 2007. We can confirm with Morningstar whether they have that information prior to that. Thank you for the report.

1

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.


Update Backtest





0

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.


Loading...

This discussion is closed