Hi Everyone,
I have created a framework that scores AlphaModels and adjusts the weights of each AlphaModel's insights based on that score.
For this to work what I really need is have the algorithm warmup for n days so that universes are selected each day as normal and all of the data pumps through the algo/alphamodels. This would allow the alphamodels to act as if they are live and generate insights and thus allow me to score them.
The issue is that we currently can't use SetWarmup with UniverseSelection. The reasoning is that the Universe is always changing so symbols need to be warmed up individually. This is definitely true and I already handle that issue without a problem. But that is really a separate issue of warming up indicators vs warming up the algorithm by having it perform normal processing for a warmup period.
Is there anyway to get the system to warmup with UniverseSelection? Meaning have it run normally from an earlier date thans start date (or if live from the current date) with UniverseSelection happening during that timespan but with the system set to Warmup so that data is pumping through, insights are being generated, but orders are not executing?
Thanks for any help,
Cole
Cole S
Looking into the Lean code and this would take some heavy refactoring I think. It currently just does history requests for manually added securities.Doing what I am asking would require incorporating Warming Up into the main loop in AlgorithmManager.Run and I'm sure there are numerous downstream issues that would need to be handled.For now I'll implement my own “warmup” that simply does not emit insights until the warmup is done. That will impact the performance metrics but still is good enough for testing. If it ever goes live I would probably need to use the objectstore to store historical alpha performance for each alpha, that way warming up would not be required.
Fred Painchaud
Hi Cole,
As you already realized, incorporating warmup inside Universe Selection would be a big project within LEAN development.
However, I am currently doing just that, i.e., implementing warmup with Universe Selection but on user side code (Python code/algo code, not in LEAN engine codebase).
While doing so, I am also implementing another concept but in a nutshell, my universe warmup is of course based on History, with which I get past data (my warmup data) and pump it into my indicators. I pump that data in for assets that get into the Universe (OnSecuritiesChanged). After tests, I decided to code indicators that handle pandas df directly and vectorize everything I could, and use list comprehension for the rest (iterating on rows/index for df is catastrophic). I do not flush everything out when securities leave the universe. I use LRU to better manage that. If everything else is connected (like your indies are in your alphas, etc), and your IsReady logic is ok, everything syncs up when primed, send insights while priming (for which you can structure data so you don't act on those), etc. Pretty much just like you describe, like if the warmup concept was present in Universe Selection (and I'd say the rest of the Algo Framework).
Hope it is clear to you…
Fred
Cole S
Hey Fred,
Thanks for the reply. I'm glad to know I'm not the only one thinking this is good feature to have. Everything you said makes sense to me, but I'm wondering how you are handling the UniverseSelection? Are you handrolling some UniverseSelction code?
Fred Painchaud
Hi Cole,
Right now, I use the built-in Universe Selection, as-is. So when new assets come in, I put all my stuff above in motion basically (especially when some new asset was not seen before). I'm not there yet but it is also possible to voluntarily make your selection broader, every day, and then re-scope during the day - if it's something desired. But that's simple, I'll add it towards the end if needed.
Fred
Cole S
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!