Back

SetWarmUp when dealing with future objects

Hi,

In this simple example I wouldn't get any data pumped in OnData before Jan 17. Simply saying algo won't warm up . Can anyone please explaine the reason why - and how do I get data to warm up the algo on futures?  First output will be following:

2018-01-17 00:00:00 TIME: 1/17/2018 12:00:00 AM
2018-01-17 00:01:00 TIME: 1/17/2018 12:01:00 AM

public override void Initialize()
{
SetStartDate(2018, 01, 17);
SetEndDate(2018, 03, 01);
SetCash(100000);
SetWarmUp(TimeSpan.FromDays(7));


future = AddFuture("BTC", Resolution.Minute);
future.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(92));
}

public override void OnData(Slice data)
{
Log($"TIME: {Time}");
}

Update Backtest







Sorry at this time we do not support warming up Universes. Because futures is a universe of contracts (+ options, equity-universe) it falls into this category. We are aware of the limitation and for now, recommend using the History API to fetch the future contract history you need on start.

Here is an example of using the futures history API to warm up your algorithm:

https://github.com/QuantConnect/Lean/blob/master/Algorithm.CSharp/BasicTemplateFuturesHistoryAlgorithm.cs

You will need the specific Symbol object for the contract. These are passed into the OnSecuritiesChanged Event.

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.


Thank you Jared, that's very helpful !

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