Hi all, I'm currently working with a coarse universe selection algorithm where the universe is set to rotate daily. However I need to have retain the ability to schedule an event minutely (say at 9:35 am). I have such an event put in place to execute orders five minutes after market open. However upon backtesting, the scheduled event I set in place always fires at 0:00:00, the same time when the universe rotates. Has anyone had this issue?
Jared Broad
Scheduling is not tied to Universe selection in anyway. The universe selection happens on a day change (i.e. midnight when possible) -- if there's actions you'd like to happen at 9.35 you're probably best to save those actions to some variable, and then look at that variable when the scheduler fires. Please share an algorithm for more assistance :)
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.
Stephen Oehler
Yup! Thanks Jared. Attached is the algo; its the example Coarse Universe selection algo from LEAN. In this all I'm doing is trying to write "Hello" at 9:35am. The result is that its being fired at 0:00:00. Here's a copy of the log it generates:
2014-01-01 00:00:00 Launching analysis for 2464f89382bf594e9a97afa858629828 with LEAN Engine v2.2.0.1.173 2014-01-02 00:00:00 Hello 2014-01-03 00:00:00 Hello 2014-01-04 00:00:00 Hello 2014-01-04 00:00:00 Algorithm Id:(2464f89382bf594e9a97afa858629828) completed in 0.36 seconds at 39k data points per second. Processing total of 13,923 data points. 2014-01-04 00:00:00 Your log was successfully created and can be downloaded from: http://data.quantconnect.com/backtests/17357/213436/2464f89382bf594e9a97afa858629828-log.txt
Michael Handschuh
Hey Stephen, the UniverseSettings.Resolution property is used to set the data resolution for subscriptions added via the universe. Coarse fundamental selection will always happen on day changes. In LEAN backtesting, data is the main driver of the concept of time, so since you only have daily data flowing throw the system, your event is being time stamped on the day change. If you set UniverseSettings.Resolution = Resolution.Minute then you'll get minute data and your event will fire when expected.
Stephen Oehler
Thanks Michael! I was initially afraid to set it to minute because I thought it might be tied to the coarse universe rotation, and thus put undue burden on your cloud. Appreciate the time, both of you, and sorry for blowing up your email. :-P Gonna post my mistakes on here so hopefully nobody else has the same ones.
Alethea Lin
Hi Bill,
Currently, since the universe selection is based on EOD data, the selected universe is not available until one day after the start date. However, our team is working to change this so that you will be able to get selected universe on the first day of backtesting based on data from the previous day. Once this is implemented, make sure you set Resolution to Minute, and you should get the selected universe at 9:30 AM on the first day of backtesting.Â
Hope this helps!
Stephen Oehler
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!