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
I read a paper today titled "A Quantitative Approach to Tactical Asset Allocation" by Mebane Faber, first published in May 2006. It's basis (implemented below) is a simple Global Asset Allocation Buy &Hold portfolio, against which we should measure the performance of the various iterations of his Global Tactical Asset Allocation Models (to follow).
As expected for a global diversified portfolio (B&H) it yields a sharpe ratio in the order of 0.4 (owning individual "Risky" assets usually returns a sharpe around 0.2). It appeasrs the previous decade has been quite extraordinary for the S&P, with a sharpe=0.7!
This is my first attempt (as a hobbyist programmer) at an algorithm on QuantConnect, using the structure provided in the AlgorithmFramework, so questions, comments & criticisms are all welcome!
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.
Derek Melchin
STAFF Pro
,
Hi Mark,
Great first attempt! Here are a few small improvements to consider:
We can create our list of symbols using list comprehension to keep Initialize dry
Rebalance at the open to avoid stale prices and disproportionate weights
Set the Insight duration to be the same as the backtest duration
Best, Derek Melchin
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.
Mark Reeve
5.8k Pro
,
Thanks Derek!
Is this what you mean by using list comprehension and insight duration (Refer attached backtest)?
What do you mean when you say to keep Initialize "dry"?
Also, I couldnt get the daterules/timerules function to work for me with PC.... eg,
Great job! This is exactly what I mean by using list comprehension and changing the insight duration.
"DRY" is an acronym for "Don't Repeat Yourself". By using list comprehension in Initialize like this, we type `Symbol.Create(...)` once instead of 5 times.
The EqualWeightingPortfolioConstructionModel constructor can't take both a DateRules and TimeRules parameter. Instead, we can accomplish monthly rebalancing after the open by passing the construct a function.
def RebalanceFunction(self, time):
if self.Time.hour == 9 and self.Time.minute == 31 and self.Time.month != self.lastRebalanceMonth:
self.lastRebalanceMonth = self.Time.month
return time
See the attached algorithm for a working solution.
Best, Derek Melchin
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.
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!