I have this algo, that select stocks based on fundamental variables and technical values. In the coarce function I use the selectionData() object to update values of short and long moving average as well as volume in order to make calculations and then pick stocks based on these values.
Im trying to understand all this logic. What I not understand is that in the first filter, that I called "filtered", ,the lenght of stocks are around 90 to 100. And then when these stocks are passed to the stateData dictionary in order to update for the target indicators, then when I filter the list of stocks where is_ready is true, in the values list comprehension, it returns only a few stocks at first, and then that list start to increment. But both list are very different in length and I dont understand why.
My question is, why the "values" list is so small in relation to the "filtered" list?
Thanks,
Nicolás
Nicolas Ferrari
Hello Xin,
I find valuable all comments and support that you provide in your response. Many thanks for that.
Analyzing what you had written, you are right in that the three updates methods should be outside the if statatement. Also, now I have a better idea of why the two list(filtered and values lists) have different length in the initial period of the backtesting.
Overall, my strategy need to use sma short, sma long and volume indicators to filter stocks in the universe, so with this approach, I think the selection process will be much more accurate.
I will run backtest and see the results.
Many thanks,
Nicolás
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!