Hey all!
I'm here to publicly announce a feature that we've all been waiting for, history and warmup! With these new features you can request historical data from any point in the algorithm. You can also specify a warm up period where we'll pump historical data through the algorithm to get it into a ready state. This is great for live trading when you have some indicators that may take weeks, months, or even years to reach a ready state. Now that same algorithm can be ready to start trading within minutes of deploying!
Here's a link to all the History and Warmup API methods on the base algorithm class.
Have a look at the simple history demo algorithm I put together for you guys. Feel free to ask questions!
Jianwei Wang
Jared Broad
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.
Jianwei Wang
Michael Handschuh
Jianwei Wang
Steven Toh
Michael Handschuh
Timothy Comisky
Michael Handschuh
Timothy Comisky
Jared Broad
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.
Timothy Comisky
Michael Handschuh
Jonathan Evans
Trader Stoyc
Jared Broad
if (!data.ContainsKey("EURUSD")) return;
Or you can set a custom benchmark so your statistics are relative to EURUSD (after AddSecurity):SetBenchmark("EURUSD");
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
Hi Jared, Quick question: if I have coarse universe resolution set to "Minute", and I need to warmup the universe, say, for 5 days (which is 1950 tradeable minutes), would I need to do the following:
SetWarmup(1950)
or is this function expecting "days" as the period, as the universe only rotates daily? Thanks!Michael Handschuh
Hey Stephen, how are you trying to use warm up exactly? Warm up runs exactly once right after initialization. If you're using universe selection and didn't manually add securities then there's nothing to 'warm-up'. If you need to get data for securities added via universe selection, have a peek at the history api. To answer your question, the periods in there is specific to each security. For example, say I have VXX minute and SPY daily and SetWarmup(100), this will get me 100 minutes points for VXX and 100 daily points for SPY. This history function behaves the same way, so you could request the last 100 data points of history for all securities using something like the following:
var slices = History(100);
Slices here is an IEnumerable<Slice>Stephen Oehler
Hi Michael, Sorry I wasn't clear earlier; I'm trying to use SetWarmup to warm up the indicators I use in my coarse universe filter (similar to the SelectionData class you implemented in the Cross EMA coarse universe example algorithm). Else, live trading the program takes several days to actually start crunching. I think I may be using SetWarmup incorrectly, and may need to use history as you suggest. I'm getting the feeling that all warmup is, is running the program for a predefined period prior to the official start date. This is VERY useful for backtesting, but I'm guessing it doesn't translate to live trading very well. :-P
Michael Handschuh
Sadly universe selection is not currently involved in the warm up period. On the first invocation of the coarse selection function you could gather all of the symbols and make one massive history request for it using the history overload that accepts symbols and a period count. Warm up does work in live trading, but only for securities that have already been added to the algorithm. In universe selection, you're scanning securities that have not been added, and so warm up won't know to get data for these guys.
Michael Handschuh
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!