Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Sector Relative Strength EMA (12, 26) Crossover Algorithms

I am new in Quantopian. Not sure anybody tried a simple sector based relative strength trading algorithms before. The rules are as followings, any information share will be appreciated.

  1. Invest only in SPDR sector funds (XLK, XLC, XLY, XLI, XLV, XLF, XLE, XLU, XLRE, XLP, XLB), SPY and GLD. Total 13 choices.
  2. Initial investment is $1,000,000 and 100% in SPY.
  3. Using RSC (relative strength price comparison) to SPY as indicator. The trade trigger is EMA (12, 26) of RSC (for example, like XLY:SPY RSC)
  4. Sell certain amount of SPY to buy the RSC EMA cross over up trend. The % allocation to buy is XLK (35% of asset), XLF (20%), XLV (20%), XLY (15%), XLC (15%), XLI (15%), XLP (10%), XLE (10%), XLB (5%), XLU 95%), XLRE (5%), GLD (10%). No trading if no SPY share to sell (whole portfolio is already in the outperform sectors).
  5. The idea is keeping the portfolio fully invest (start with SPY, and stay in SPY if no trading trigger). Buy the outperform sectors if the RSC EMA (12, 26) crossover up happen (trading trigger). This will make portfolio overweight on the outperforming sectors.
  6. If the RSC EMA (12, 26) crossover down trend happen, sell the underperforming sector and switch back to SPY. So, the underperform sector will back to market weight (as SPY).
  7. The idea is to keep the portfolio fully invested, and overweight on the outperform sectors to improve the performance. The % allocation is a risk control not to over invest in certain sector (over concentration) for a balance portfolio.
  8. I expect this algorithm will outperform the SPY in the back test, and lower drawdown (less risk) in the bad time.
  9. If nobody tried this approach before, please point me to the similar approach. Highly appreciated.

Jerry Liou