So, I haven't played around with universe's much in QC yet. I tried implementing the QC500 to an existing algo, which worked, just with horrible results, but then when I tried using the EMA selection model, first using the framework, then literally just copy pasting the import and changing self.SetUniverseSelection accordingly, it would not place orders, and it seemed as if the universe was empty.
I definitely do not want 500 securities anyways though, so I tried to fit one of the example universe selection algo's from QC's github into the existing algo of mine so that it would work, but again, it would not place orders.
My only thought was that because I have a symbol data class, perhaps it is in the frameworks ema selection model and was interfering, whereas the qc500 which did run, does not.
In the end, would like to have a universe somewhere in the 10-50 range of liquid securities that are trending upward, but I would still like to use minute resolution outside of universe selection. If I could get the framework to work, great, or doing it through my own universe selection is fine as well.
Attached is my attempt at splicing in the relevant bits of the EMA selection algorithm, but without that, just using the QC500 model, the algorithm does run.
Any advice would be appreciated.
Varad Kabade
Hi Victoria Butler,
In the above algorithm, the universe selection uses an indicator that requires 117000 samples to be ready, so it won't make any selection. This results in no stocks getting added to the universe.
To resolve this, we can have a history request inside the DataSymbol object to make sure the indicator is ready, and/or we can reduce the indicator period.
Best,
Varad Kabade
Yuri Lopukhov
You should know that warm up isn't working for universe selection (self.OnSecuritiesChanged will not be called during warm up), so you have to warm up your indicators manually from self.History. I'm not even sure if it works at all. It didn't call self.OnData with securities added in Initialize for me, but I didn't dig into that, I just got used to warm up manually, since most of the time I use universes anyway…
Victoria Butler
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!