Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
ETF 100/500 MA Crossover

Here is a simple long-term momentum strategy that mitigates large downturns in the overall market. It invests in SPY (S&P 500 index ETF) when SPY's 100-day moving average is above its 500-day moving average. When its 100 MA crosses below its 500 MA, the strategy invests 30/30/30% in 20+ yr t-bonds, gold, and consumer staples ETFs. These asset classes usually weather bear markets relatively well. The remaining 10% sits in cash.

I would love to hear how you would improve this algorithm.

1 response

Here is what it looks like when 2x leverage is applied to SPY. What do you think about adding margin in the good times and using a simple moving average crossover to indicate when to get off of it?