I'm new to Quantconnect and algo trading in general, and may have only intermediate Python programming skills. I thought I'd practice by trying to code a strategy I read in a book "Automated Stock Trading Systems". I'm trying to do it in parts but running into trouble relatively early. The strategy calls for:
Universe: average dollar volume > 50M and Price >$5.
Setup: S&P > 100 SMA and
Stock 25EMA > 50EMA, ranked by the highest rate of change over 200 trading days. Take top 10 stocks in equal weighting.
Stop-Loss: 5xATR with trailing stop loss of 25%.
-----
I've tried to code the first part, using a Coarse universe filter and then creating EMA filters using a SelectionData class, similar to the BootCamp guide. However, I'm getting most of the stocks with the error "No data loaded because there were no tradeable dates for this security"
I'm also skeptical as to whether I'm doing the universe selection correctly. Is there a faster or more efficient way to do what I'm trying to do?
Thanks in advance!
Shile Wen
Hi Derek,
I don't see any clear issues with the algorithm. Furthermore, the reason the universe selection is slow at the beginning is because of all the History data requests, so after these calls are done, the algorithm should speed up.
Best,
Shile Wen
Derek E
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!