Hello, I found an error in a quantconnect code of one of Quantpedia's strategies : Net Current Asset Value Effect
When I try to run myself the backtest attached to this strategy, I get this error :
Runtime Error: TypeError : property is read-only
at FineSelectionFunction in main.py:line 36
:: i.MarketCap = float(i.EarningReports.BasicAverageShares.ThreeMonths * (i.EarningReports.BasicEPS.TwelveMonths*i.ValuationRatios.PERatio))
TypeError : property is read-only
I'm pretty new to coding with Quantconnect, so I can't figure out what's wrong with the code.
Can anybody help ?
Rahul Chowdhury
Hey Alexandre,
The MarketCap field of the FineFundamental object is read only, meaning we can not set its value. The market cap of a company can be accessed directly through its fine fundamental object and does not need to be calculated.
If we remove these 2 lines where we try to set MarketCap, it will remove the read only error.
for i in fine: i.MarketCap = float(i.EarningReports.BasicAverageShares.ThreeMonths * \ (i.EarningReports.BasicEPS.TwelveMonths*i.ValuationRatios.PERatio))
MarketCap was previously not supported, so older algorithms had to calculate its value manually. However, MarketCap is now available with FineFundamental.MarketCap.
Best
Rahul
Alexandre
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!