I ported over Keller and Keunig's Protective Strategy into QuantConnect. The code is slightly different but was translated from this Quantopian post.
"Protective Asset Allocation (PAA): A simple momentum-based alternative for term deposits" based on Keller and Keuning (April 25, 2016)
http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2759734
Strategy goal:
- Average, unleveraged return better than SP500 (achieved)
- Significantly reduced drawdown vs SP500 (achieved)
subject to constraints:
- Monthly rebalancing
PAA strategy summary
1. consider a proxy set of N assets
2. select a protection factor (see below) and maximum number of assets to hold (TopN)
3. count the number (n) of the risky assets with positive prior month MOM (see MOM definition below)
4. compute the bond fraction (BF): BF = (N-n)/(N-n1). (see n1 definition below)
5. Invest a fraction BF of the portfolio into the safe set (bonds)
6. From a set of equities invest the remaining fraction (1-BF) in the top n_eq equities sorted on MOM
7. Hold for one month and then repeat to rebalance
Definition of terms used by Keller and Keunig
- momentum (MOM): to be MOM = (last month's close)/(SMA over lookback period) - 1
- lookback period (L): L is measured in months
- protection factor (a): a = [0, 1, or 2] is used to adjust the BF gain: n1 = a*N/4
- number of equities to be purchased (n_eq): n_eq = min(n,topM)
I am a self-taught developer so the syntax may not be the most enjoyable, but have at it.
Thanks,
Aaron
DEVON
good job, thanks a lot your sharing.
Michael Manus
cool stuff, very interesting. thanks for sharing this to the community.....
Jing Wu
Hi Aaron, thanks for sharing and nice work! By clicking the link you provided, I found a series of asset allocation algorithms of Keller and I'm pretty interested. I'm going to implement some of them on QuantConnect to see the performance.
In your algorithm, instead of creating the dictionary to store multiple indicators for different symbols, you could add those indicators as the property of the symbol object. Next time you want to use those indicators just call the corresponding property of the symbol. You could also add as many properties as you like to the symbol object. I attached a sample for your reference.
Aaron Gilman
Awesome - thank you Jing. I appreciate you cleaning that up for me and teaching me a thing or two along the way. I tend to be a tad bit overly verbose in both life and my code. Thanks again!
TBird
Great work! I am digging into Keller algos myself and it was great to see your work. I simply added a SPY graph on the equity curve to see the performance of both side by side. I also changed starting capital to 100000.
I didn't review “average return”, but SPY, I believe, had a CAGR of around 8.82% since 2008 (based on this calculator: http://www.moneychimp.com/features/market_cagr.htm). Your backtest produces CAGR of around 5.7%. Not sure that qualifies as outperformance of SPY. Anything I am overlooking?
Aaron Gilman
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!