How to import QC500 into my main.py within the algorithm lab

Back

Hio i'm having trouble correctly importing the QC500UniverseSelectionModel(FundamentalUniverseSelectionModel) into my main.py file using AddUniverseSelectionModel()

So I went ahead and just copied it into my file and used self.AddUniverse(self.SelectCoarse, self.SelectFine)

but it keeps throwing an error for my SelectCoarse function saying that I dont have the argument 'coarse' even though i clearly do. 

https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_8d74e631077199d6cee2d745acc12b6e.html

If someone could help me with this or give me an answer to how I can easily import this 

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.py

into my main.py file and get it to work would be great. Any resources would be very helpful

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 Nathan,

To import the QC500 universe, we can write

self.SetUniverseSelection( QC500UniverseSelectionModel() )

in the Initialize method.

See the attached backtest for an example.

Best,
Derek Melchin

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.


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