Hey guys,
Does anyone know if there is a way to set the time when your algo's Universe is updated? For example, if I wanted to update my universe right before market open, instead of at midnight.
QUANTCONNECT COMMUNITY
Hey guys,
Does anyone know if there is a way to set the time when your algo's Universe is updated? For example, if I wanted to update my universe right before market open, instead of at midnight.
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.
Michael Handschuh
Riley O'Shea
Travis Teichelmann
Hey Micheal Can please you show me an example of how to use a user defined universe with a custom data source? https://www.dropbox.com/s/qx8hs2q81im9zmu/SymbolToday.csv?dl=1 Thanks so much
Jared Broad
@Travis - please check out this Github example: https://github.com/QuantConnect/Lean/blob/master/Algorithm.CSharp/CustomDataUniverseAlgorithm.cs
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.
Travis Teichelmann
@Jared Thank you, I've used that example and got it to work with my custom data. Now I'm trying to get the algorithm to read from my data source five minutes after the market opens, add and then buy the symbol. I Noticed that the example above has
AddUniverse(new PreMarketDailyUsEquityUniverse(UniverseSettings, TimeSpan.FromMinutes(10), dateTime = {
but that doesn't work either...Michael Handschuh
When you say it 'doesn't work', do you mean it doesn't compile? If so, make sure you copy the PreMarketDailyUsEquityUniverse class from the sample since it's not provided as part of the base engine. If the issue is something different, please attach a sample project and I'll take a look at it.
Travis Teichelmann
I added all of the code from your example to try and pre-charge the algorithm but I wasn't adding a subscription on initialize. I appreciate the help.
James Reilly
@MichaelH,
Do you happen to have or know of an example of executing coarse universe selection at a custom specified time or on initialization? Is this even possible?
Richard Hamilton
I should be grateful if someone would provide me with the necessary changes to fix the following two errors in the above algo:
Build Error: File: Main.cs Line:71 Column:14 - 'UserDefinedUniverse' does not contain a constructor that takes 4 arguments
Lines 70 & 71 are:
public PreMarketDailyUsEquityUniverse(UniverseSettings universeSettings, TimeSpan timeBeforeMarketOpen, Func<DateTime, IEnumerable<string>> selector) : base(CreateConfiguration(), universeSettings, TimeSpan.MaxValue, selector)
Build Error: File: Main.cs Line:80 Column:74 - The call is ambiguous between the following methods or properties: 'MarketHoursDatabase.GetEntry(string, string, SecurityType)' and 'MarketHoursDatabase.GetEntry(string, Symbol, SecurityType)'
Line 80 is:
var marketHoursDbEntry = MarketHoursDatabase.FromDataFolder().GetEntry(QuantConnect.Market.USA, null, SecurityType.Equity);
Jared Broad
Hi Richard! Glad you're diving into the open source! But we can't do support for that here, please use google groups if possible and attach all your config and sample data so we can replicate the issue:
https://groups.google.com/forum/#!forum/lean-engine
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.
Quant Trader
@Richard Hamilton: your call to PreMarketDailyUsEquityUniverse does not match the parameters, you pass 4, but 2 are accepted. The other is a casting issue, you can cast with (string) or (Symbol). Can you share your code so I can have a look?
Richard Hamilton
@Quant Trader, thanks for the comments. The full algo can be cloned from above...it's from Michael Handschuh's reply to the op.
Quant Trader
this is first fix:
var marketHoursDbEntry = MarketHoursDatabase.FromDataFolder().GetEntry(QuantConnect.Market.USA, (Symbol) null, SecurityType.Equity);
second fix under investigation as I set null, but maybe you need to give an interface to an initialized object;
public PreMarketDailyUsEquityUniverse(UniverseSettings universeSettings, TimeSpan timeBeforeMarketOpen, Func<DateTime, IEnumerable<string>> selector) : base(CreateConfiguration(), universeSettings, null, TimeSpan.MaxValue, selector) { _timeBeforeMarketOpen = timeBeforeMarketOpen; }
Quant Trader
fixed
Richard Hamilton
@Quant Trader, ty, very much appreciated
Riley O'Shea
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!