Here's an algo that demonstrates Quantconnect's coarse universe capabilities, and provides a template for universe based strategies. You should be able to easily add/remove indicators to the StockData class and adjust the code concerning indicators to change the strategy.
The strategy that comes with it only seems to work over the last year. That could be due to overfitting or favorable recent market dynamics.
Use at your own risk. Please report any bugs below.
Michael Manus
Sari Louis
top-gainers-universe
JayJayD
Warren Harding , as always your algos are great!
Sari Louis
Thanks for keeping me in mind, Michael Manus. As is, this algorithm is tracking only the top 5 dollar-volume stocks. When I change it to 500, for example, it times out. I feel I need to dig into the source code of LEAN on Git. I think LEAN still tries to pump data into all 500 stocks, and I essentially need to find a way to limit it to only 10 or so to track on any given day. I'll be sure to post any findings--if I find any :)
Warren Harding
Thanks JayJayD, I appreciate that.
Petter Hansson
Before anyone considers trading, test on second half of 2008.
It's certainly a good demonstration/template though.. There's also EmaCrossUniverseSelectionAlgorithm in the Lean examples which shows how to analyze stocks before they're added to universe.
Kern Winn
Terrific, Warren. Thanks! I'm adding it to my growing QC arsenal.
Warren Harding
Thanks, Kern.
Warren Harding
Here's a buggy version. I changed the totalHighDollarVolumeStocks variable to 50, so the algo is using a larger coarse universe. The backtest hangs in March, 2017. Anyone know if the bug is in my code or in Quantconnect? I don't want to rush to blame Quantconnect, but I can't imagine what in my code would cause this either.
Jared Broad
Andrew Hart is actively working on a bug with the universe selection hanging now (then timing out) due to some of the symbols not having factor files yet. We'll post a note back here once its fixed.
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.
Fred Saff
Hi Jared. It seems the universe selection's bugs still haven't been fixed just yet. Any update?
Jared Broad
Yes its been resolved
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.
Warren Harding
Looks like a breaking change has left my algo flatlining. I'll try and post an update shortly.
Warren Harding
OK, here's an update. It seems to work fine with larger universes.
Warren Harding
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!