Back

Algo: Universe Template 1.0.0

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.

Update Backtest








1

Warren Harding , as always your algos are great!

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.


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

Thanks JayJayD, I appreciate that.

0

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

Terrific, Warren. Thanks! I'm adding it to my growing QC arsenal.

0

Thanks, Kern.

0

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


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.


Hi Jared. It seems the universe selection's bugs still haven't been fixed just yet. Any update?

0

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.


Looks like a breaking change has left my algo flatlining. I'll try and post an update shortly.

0

OK, here's an update. It seems to work fine with larger universes.

2


Update Backtest





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.


Loading...

This discussion is closed