Back

Is it possible to have the universe and indicators run daily, but the trades happen on minute or tick bars?

(and is there any example out there for how it's done...)

Update Backtest








Yes, it is possible.
We need to create a Custom Universe that will update the universe daily, while we set UniverseSettings.Resolution to the intraday resolution we desire.

// In Initialize method:
UniverseSettings.Resolution = Resolution.Second;
// Or Resolution.Minute, Resolution.Hour

AddUniverse(new YourCustomUniverse(UniverseSettings,
SecurityInitializer, TimeSpan.FromMinutes(10), dateTime =>
{
Debug("Universe selection trigger time: " + dateTime);
// here's where you can do your custom selection logic
// For example, your custom selection returns AIG, BAC and IBM
return new List<string> {"AIG", "BAC", "IBM"};
}));

 

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.


@Alexandre Is it possible to do this with a Coarse Selection Universe...Say I want Daily Resolution, but only need to update the universe every three months?

0

Yes, it is possible. We need to include a check for that condition in the selector parameter of the AddUniverse method:

public IEnumerable<Symbol> CoarseSelectionFunction(
IEnumerable<CoarseFundamental> coarse)
{
// Only selects a new universe every three months
// on the first day of the month
if( Time.Month % 3 != 0 || Time.Month == month)
{
return Universe.Unchanged;
}

month = Time.Month;

// Universe selection logic that returns IEnumerable<Symbol>
}

 

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