LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
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.
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.
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.
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 :)
0
Warren Harding
58.2k Pro
,
Thanks JayJayD, I appreciate that.
0
Edited by Warren Harding
Petter Hansson
10.5k Pro
,
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.
1
Kern Winn
29 Pro
,
Terrific, Warren. Thanks! I'm adding it to my growing QC arsenal.
0
Warren Harding
58.2k Pro
,
Thanks, Kern.
0
Warren Harding
58.2k Pro
,
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.
0
Jared Broad
Pro
,
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.
0
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
199 Pro
,
Hi Jared. It seems the universe selection's bugs still haven't been fixed just yet. Any update?
0
Jared Broad
Pro
,
Yes its been resolved
0
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
58.2k Pro
,
Looks like a breaking change has left my algo flatlining. I'll try and post an update shortly.
0
Warren Harding
58.2k Pro
,
OK, here's an update. It seems to work fine with larger universes.
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.
Loading...
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!