(and is there any example out there for how it's done...)
QUANTCONNECT COMMUNITY
(and is there any example out there for how it's done...)
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 Catarino
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"}; }));
Caleb Sandfort
@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?
Alexandre Catarino
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> }
Kbsaravana
Alexandre Catarino , is It possible to have custom universe with coarse /fine selection which run daily but the trades can run in minutes. I'm expecting something likeÂ
// In Initialize method:
UniverseSettings.Resolution = Resolution.Second;
// Or Resolution.Minute, Resolution.Hour
public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)
{
// custom logic to check Price & daily volume
var stocks = (from c in coarse
where c.Price < 500 && c.Price > 1
orderby c.Volume descending
select c.Symbol).Take(500).ToList();
return stocks;
}
public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)
{
// custom logic to filter with company profile data
var fineStocks = fine.Where(x => x.CompanyProfile.MarketCap> 300000000 && x.CompanyProfile.SharesOutstanding < 50000000m).Select(x => x.Symbol);
return fineStocks;
}
AddUniverse(new YourCustomUniverse(UniverseSettings,
SecurityInitializer, TimeSpan.FromMinutes(10), dateTime, CoarseSelectionFunction, FineSelectionFunction));
Â
Derek Melchin
Hi Kbsaravana,
It's not currently possible to chain universe selection like that. Coarse and fine data are updated once per day, so running them every 10 minutes won't give new information.
Best,
Derek Melchin
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.
Eyal netanel
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!