Hello,
Relatively new to Quantconnect. Just discovered the research environment and much prefer it for coding. I have a few questions: I have scoured the Quantconnect forums and documents, but have not found an answer to my questions. I know how to do these things in the backtest environment, but apparently the capability of the research environment is much different.
1. Since the hypothesis I'm testing is based in part on the right combo of coarse and fine universe selection factors, testing on a small fixed list of symbols in the research environment does not meet my needs. I know that Universe Selection (coarse and fine) do not work in the research environment. Pity, because choosing the right universe based on a certain combination of fundamentals is part of the hypothesis I'm testing. As a workaround, is there a way for me to import a CSV list of symbols filtered on volume into the research environment? .
2. Is there a way to filter a list of symbols in the research environment - similar to that in the backtest environment - based on multiple fundamentals and technicals? Maybe an 'if, and, then' approach?
I know I can accomplish both of these in the backtest environment, but the notebooks are so much easier (and more familiar) to develop and test in.
Thanks much! H
Hector Barrio
Holly, the best approach is probably to add a long list of symbols into the quantbook, the price history of these symbols will have the volume history and it can be filtered. This snippet in research will net you the same history a backstest would pass through in execution, then in becomes a matter of handling the multiple dataframes for filtering as needed. It may take a while to process if the symbol list is huge.
self = QuantBook() start = datetime(2020,6,1) end = datetime.now() # Make this list as long as needed: symbol_list = ['CAT', 'DOG', 'IBM', 'NUE'] symbols = {} for symbol in symbol_list: symbols[symbol] = self.AddEquity(symbol).Symbol symbol_list = list(symbols.values()) history = self.History(symbol_list, start, end, Resolution.Daily) # If needed, filter symbols by volume to reduce fundamental calls here. # Make this list as long as needed: selectors = ["OperationRatios.CashRatioGrowth", "FinancialStatements.IncomeStatement.EBITDA"] fundamentals = {} for selector in selectors: fundamentals[selector] = self.GetFundamental(symbol_list, selector, start, end)
Holly russo
Thanks Hector. I already know how to hard code the list of stocks, but doing so for over 7,000 of them is a bit tedious. Even if I manually filtered a CSV list from Quandl or somewhere down to the top 1,000 in volume, it would take me a long time to hard code all of those. That's why I want to import them.
Jared Broad
We're working on it :) it should be live this week. Easy work around is to use the object store to store your symbol list to a date from a backtest, and use the tickers from the date you'd like. Universe selection in backtesting works well.
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.
Holly russo
Thanks Jared! Yes, it does work well in backtesting, and I look forward to it in research. Cheers, H
Holly russo
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!