Sorry if this has been asked before:
Recently I've turned off fillForward (which is on by default), because it gets me closer to reality. (Of course, this forced me to fix my sloppy code to check for null pointer exceptions)
It would save everyone a lot of time if there were a convenience method that returned exactly 100 slices, and only slices that have data for ALL symbols in my syms array.
IEnumerable<Slice> slices = History(syms, this.StartDate.AddDays(-102 * 7 / 5), this.StartDate, Resolution.Daily);
Wouldn't it be more correct to deprecate the AddDays() function and suggest using a new
AddTradingDays(-100, "SPY")
or maybe
AddTradingDays(-100, Securities.Keys )
?
Of course, maybe there's a more correct solution / more efficient solution for warming up a 100 day indicator?
Ray Bohac
Check out the SetWarmup method. It can be called as SetWarmup(int) or SetWarmup(Timespan)
I recommend also using the IsWarmingUp() method in your OnData event to prevent unexpected behavior
Documentation at https://www.quantconnect.com/lean/documentation/topic330.html
Examples can be found at https://www.quantconnect.com/forum/discussion/813/feature-history-and-warmup
Keith K
Thanks Ray.
I'm using a shorter 5 day SetWarmup() period at Resolution.Minute... in addition, I have a 100 day History() at Resolution.Daily. 100 days of warmup at Resolution.Minute takes too long.
Maybe is there a way to adjust the SetWarmup resolution as you get to the closer to the start day?
Jared Broad
Hi Keith; assuming you're talking about live trading - using the History API directly is probably the best bet for you.
We're finish off a new history server now technology now. It'll be roughly 100x faster :). It should be installed this week.
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.
Hemant Verma
Jared you guys are awesome. Looking forward to when the history stuff is available. More so I am looking forward risk control statergies and algorithm framework that we talked about in other thread.
Great work guys!
Keith K
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!