[EDIT: see bottom of thread for most recent versions]
Hey everyone,
I just secured my Quantcon ticket, so I'll take the opportunity to say 'Hi!' to the community and give back a little with an implementation from the quant blogosphere.
The attached algorithm is an adaptation of a recent tactical asset allocation portfolio from David Varadi @ CSSAnalytics: "A Simple Tactical Asset Allocation Portfolio with Percentile Channels". I took the freedom to modify it slightly from the original, as noted in the code.
- ASSETS: US stocks, EAFE stocks, US REIT, US Corporate Bonds, US Government Bonds (= cash)
- BUY RULE: Long position if current price >= 0.75 percentile of [60, 120, 180, 252] days channel
- SELL RULE: Sell position and move to cash if current price <= 0.25 percentile of [60, 120, 180, 252] days channel
- ACTIVATION: Once a month, 5min before the close of the last trading day.
- SIZING: proportional to channel count and inverse share in 20-day universe volatility
The strategy is simple and consistent and I like it for its use of percentile channels. Of course, it isn't optimized, but for a monthly approach it has fairly low volatility and draw down (less than 10 percent). Notably, when back testing with our Quantopian data, there isn't a single down-year and it still provides the performance of a balanced 60/40 portfolio. As a caveat, I'll point out that it often relies on corporate and government bonds and I wonder whether it will keep performing in an environment of rising interest rates.
I hope you'll find this implementation useful or, at least, fun to play with. I've certainly learned an interesting spin on percentile channels from it. In the same vein of learning, I'd appreciate your feedback on my implementation as I'm just getting warmed up with the Quantopian platform.
See you at Quantcon. Cheers!