Back

Schedule an Event minutely when universe is set to daily

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?

Update Backtest








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 :)

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.


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

0


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.

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.


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.

0

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