I'm trying to port an algorithm from Quantopian to QuantConnect and am not sure how a couple of concepts translate. On Quantopian, I use attach_pipeline to setup my filtering (including universe), I use schedule_function to do my portfolio construction once per week on a specific day at a specific time, then I use schedule_function again to do my order execution one hour after portfolio construction (to model my real world behavior of having a time window in which to manually place my orders). With the QuantConnect algorithm framework, I can specify a portfolio construction model and an order execution model, but I'm unclear on how to actually control the timing of these operations. It seems like I want my portfolio construction model to query my alpha model at a specific day/time, then I want to trigger my order execution model at a different day/time, but I don't see how I would set something like this up with QuantConnect. Any tips on how to achieve something like this?
Jason Mark
I was a Quantopian user also but then made the transition because I felt that the QuantConnect LEAN Engine had clearer documentation and was better maintained than the Quantopian Zipline library. The transition wasn't seemless but I got started by reading the QuantConnect docs then doing the QuantConnect bootcamp lessons. QuantConnect's CoarseFundamental and FineFundamental functions are the closest things that I think QuantConnect has to Quantopian's pipeline. In regards to control flow, you can use the Schedule.On function. If you are in the OnData method that is called repeatedly based on your securities Resolution, you can use the Time object to check the backtest datetime.
Â
Ryantrem
Thanks Jason Mark . I had already read the docs and gone through some of the tutorials, but didn't feel like those really gave me an answer for how to achieve what I described above. I will look deeper into Schedule.On and post back here if I manage to get things working and learn something in the process. It would be nice if QuantConnect provided some guidance for those who are trying to bring algorithms from Quantopian/Zipline.
Ryantrem
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!