Is it possible to create a universe selector that will select:
1. ETFs,
2. options for ETFs,
3. futures for ETFs,
4. REITs,
5. ETFs that consist only REITs?
QUANTCONNECT COMMUNITY
Is it possible to create a universe selector that will select:
1. ETFs,
2. options for ETFs,
3. futures for ETFs,
4. REITs,
5. ETFs that consist only REITs?
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.
Arthur Asenheimer
Hi,Â
ad 1.) in your CoarseSelectionFunction you can do something like:
etfs = [x.Symbol for x in coarse if not x.HasFundamentalData]
Not sure if this is a fail-safe solution since there could be other securities without fundamental data but it's the best solution I've found so far.Â
ad 2.) Since you have a list of ETFs by 1.) you can get the corresponding Options by using AddOption() and SetFilter() as demonstrated here.Â
ad 3.) I don't know about Futures for ETFs .... Could you give me an example? Do you mean securities like ESÂ (E-Mini S&P 500 Future) ? They are derived from their corresponding Indices (like S&P 500 Index), not from the ETF (SPY). You can get the Future contracts as follows:Â
future = self.AddFuture(Futures.Indices.SP500EMini)
future.SetFilter(timedelta(30), timdelta(182))
See here for more information.Â
ad 4.) Fortunately, there is a property IsREIT for FineFundamental objects. So you can get them by doing:
FineSelectionFunction(self, fine):
reits = [x.Symbol for x in fine if x.CompanyReference.IsREIT]
ad 5.) No, I don't think so. I guess you have to create you own list of REIT ETF tickers and add them via ManualUniverseSelection or AddEquity(). For example as follows:Â
reit_etf_tickers = ["REET", "SCHH", "RWR"]
reit_etfs = [self.AddEquity(ticker).Symbol for ticker in reit_etf_tickers]
Â
Quanter
1. I don't understand the assumption that not having fundamental data would equal being ETF.
2. Thanks.
3. Thanks.
4. Thanks.
5. Thanks.
Quanter
6. How can I create a universe with tickers that are traded in USD?
Arthur Asenheimer
Well, ETFs don't have (corporate) fundamental data like earnings per share, market cap etc. Thus, we should select ETFs this way. And as already mentioned, I'm not sure if this is a fail-safe solution. You should test it. But it seems to work well as far as I can see.Â
Re 6.) You can use the CurrencyId property of FineFundamental objects:Â
Â
Â
Quanter
I can't just assume, that if I don't know what it is then it must be an ETF. There must be a better way.
Arthur Asenheimer
>>Â I can't just assume, that if I don't know what it is then it must be an ETF. <<
I never said that. We know SecurityType is Equity and cf.HasFundamentalData returns False.Â
There is no property cf.IsETF for CoarseFundamental objects. For the current, the best solution/workaround I can see is the one I've mentioned above.Â
However, I've submitted a GitHub issue for this purpose. You can track the progress here.Â
Quanter
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!