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
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.
Alexandre Catarino
100.3k
,
Hi Dave, I attached an ETF Global Rotation Algorithm as a working example for you to build on. Answering your questions: 1. Using the code below to select the top 3 ETFs:
var bestGrowth = orderedObjScores.First();
var ETF = orderedObjScores.Range(0,3);
// ETF[0] equals best growth ETF, same as bestGrowth
// ETF[1] is the second best growth ETF
// ETF[2] is the third best growth ETF
2. You can add a volatility criteria using the standard deviation indicator like this:
var oneMonthVolatility = STD(symbol, 30, Resolution.Daily);
After you include this indicator in your code, you can pass it to the SymbolData object and include it in the ObjectiveScore member with the weights you define with some optimization process. This score is your ranking criteria. You can use this criteria to buy the ETF with the highest score (like we do in this algorithm), you can sell the ETF with the lowest score, you can buy the top half and sell the bottom half, etc...
I hope I could help.
P.S.: I suggest you to use this algorithm as a starting point. You could change the symbols to reflect that article, change the indicators (use ROCR - RateOfChangeRatio instead of MOM - Momentum) and modify the weights.
0
Dave B
103
,
Hi Alexandre!
Thank you very much for your assistance. I'll review and give your suggestions a try.
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!