Back

SetWarmup behavior questions

How does SetWarmup(10) work when launching live trading algorithm over the weekend or after hours? Will it get 10 bars at give resolution before market last closed and run it though OnData() ?
Also please describe how exactly 10 bars are retrieved i.e. take current time then take away 10 bars worth of time at given resolution and then retrieve the bars ? or is it simply going to array of bars at given resolution and retrieves 10 bars before market closed ? How does extended hours play here ?

In my local I don't see warm up being performed unless I use "large number" of minute bars (my security resolution is minute resolution). This could be explained if warmup uses current time as opposed to market closing time perform math.
Update Backtest








SetWarmup(barCount) will attempt to get the correct number of bars returned regardless of weekends. So what it does is finds the start time such that the correct number of bars would be returned via iterating backwards, taking into account the exchange's hours. Here's the helper function that figures this out. Extemded hours play into the exchange.IsOpen check in the function.
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