Back

How to use QC500 code in my algorithm

i see Quantconnect has a QC500 example,but it is a class type like this:

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

i want to chage it to QC1500,but how can i use this code in my algorithm? I copy the code ,and use it in initialize:

self.SetUniverseSelection(QC500UniverseSelectionModel)

 

but it show mistake: need the argument algorithm in "def SelectCoarse(self, algorithm, coarse):"

but if i use the class like this:

A=QC500UniverseSelectionModel

A.SelectCoarse(myalgorithmname,coarse)

if show mistake: the coarse is not defined

 

so ,anyone can help me and tell me how to use the class QC500UniverseSelectionModel(FundamentalUniverseSelectionModel):

 

thanks!

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.


CreateUniverses() missing 1 required positional argument: 'algorithm'
0

Hi Zeng,

Please share a backtest or code snippet so that we can assist you.

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