Hi All,
This might be a rookie mistake but I'm trying to filter fine fundamental data based on quick ratio but in Python it seems to be unable to find it, I get the following error:
Runtime Error: TypeError : Cannot get managed object
at <listcomp>
filteredFine = [x for x at fine if x.OperationRatios.QuickRatio >= 1]
File "main.py" in main.py: line 72
(Open Stacktrace)
My code looks like this:
def SelectFine(self, algorithm, fine):
filteredFine = [x for x in fine if x.OperationRatios.QuickRatio >= 1]
The same QuickRatio property works in C#. Might this be a bug or am I misusing the API? Perhaps the Quick Ratio is available in a different class?
Arthur Asenheimer
Hey Viktor,Â
fine.OperationRatios.QuickRatio is a multi period field and as such, you need to specify a period. For QuickRatio the available periods are OneYear and ThreeMonths. I'm not sure what you need but the following examples should work:Â
1.)
2.)
Viktor Somogyi-Vass
Thanks, that makes sense. I guess it worked in C# because there it has a default period.
Viktor Somogyi-Vass
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!