(and is there any example out there for how it's done...)
Don't have an account? Join QuantConnect Today
QuantConnect Community Discussions
QUANTCONNECT COMMUNITY
LEAN is the open-source algorithmic trading engine powering QuantConnect. Founded in 2012 LEAN has been built by a global community of 180+ engineers and powers more than 300+ hedge funds today.
Join QuantConnect's Discord server for real-time support, where a vibrant community of traders and developers awaits to help you with any of your QuantConnect needs.
The Open-Quant League is a quarterly competition between universities and investment clubs for the best-performing strategy. The previous quarter's code is open-sourced, and competitors must adapt to survive.
Run daily universe and indicators with minute/tick bar trades - possible? Examples?
Continue ReadingRefer to our Research Guidelines for high quality research posts.
Create an account on QuantConnect for the latest community delivered to your inbox.
Sign Up Today
|
|
|||||||
|
|
||||||||
|
Is it possible to have the universe and indicators run daily, but the trades happen on minute or tick bars?
Eyal netanel | eyal netanel | September 2016
(and is there any example out there for how it's done...)
QuantConnectâ„¢ 2025. All Rights Reserved
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"}; }));
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.
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?
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 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> }
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.
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));
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.
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.
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!