Back

When is OnData(Slice) triggered?

I thought it is triggered according to resolution of universe. But it is not triggered daily while my universe resolution is set to daily in my backtest below. What am I missing?

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.


Hi Bill. OnData is triggered whenever new data comes in which, in the case of your algorithm, really should be daily. What output are you looking at which suggests it's not triggered daily?

0

Hi Douglas.

In Logs menu in a backtest of my code OnData is triggered twice at 20070703 00:00:00 and 20070704 00:00:00 in July. (You can see it by looking for "Security changes: ..." in Logs.) 

But why is it not triggered on 20070701, 20070702 and 20070706, ...?

My guess is,

  • 20070701: It's Sunday so there is no new data and therefore OnData is NOT triggered. OK.
  • 20070702: It's Monday and there is new data from universe selection that happened yesterday. But OnData is NOT triggered on this day. Why?
  • 20070703: OnData IS triggerd on this day. But why?
  • 20070704: On this day there is no universe selection (because it is set to happen once a month on month start) but OnData IS triggered. Why?
  • 20070706 and later: On these days there is no universe selection so threr is no new data and threfore OnData is NOT tirggered. OK.

I need some clarification. Thanks.

0

Hi Bill! It takes a while to really understand the flow of time and when things are triggered but most of the time it helps to assume LEAN's correct and then think of what we might be forgetting. Common reasons are: holidays, splits-corporate events, weekends, universe data, fill forward etc etc.. You have to review your slice object to see more.   

Universe settings control the settings of data added *to* the universe, not the universe resolution itself.

 

https://www.quantconnect.com/data

 

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.


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