S&P 500 Long-Term Momentum Tactical Model

This S&P 500 timing model is comprised of 2 components:

1) A 10-period (50 days) Exponential Moving Average (EMA) and 40-period (200 days) EMA are plotted on the weekly chart of the S&P 500. When EMA10 crosses from above to below EMA40, a sell signal is generated. When EMA10 crosses from below to above EMA40, a buy signal is generated.

2) A 10-period (50 days) Relative Strength Index (RSI) is plotted on the weekly chart of the S&P 500. Then, a 40-period (200 days) moving average (MA) of the RSI is plotted. When the MA crosses from below to above 50, a buy signal is generated, indicating that the market has entered the accumulation phase (bull market). When the MA crosses from above to below 50, a sell signal is generated, indicating that the market has entered the distribution phase (bear market). For simplicity, I've hidden the RSI and only the MA is shown.

IMPORTANT: The model requires 2 sell signals from both components to exit an existing long position but it only requires 1 buy signal from either component to initiate an existing long position. When an existing long position is exited, the model goes to cash until it re-initiates a new long position. As you can see, the model right now is super close to exiting its current long position that was initiated back in December 2011; I'm expecting this to happen next week.

My model is extremely accurate in predicting major crashes and bear markets, such as the 2000 Tech Bubble and 2008 Financial Crisis. However, minor market corrections like the one 2011 could generate fake-out signals and fool the model into thinking that a major crash/bear market is coming when in reality, the market quickly rebounded following the short correction. The strength of the model lies in its ability to predict and avoid major crashes/bear markets, not small corrections. Additionally, the model cannot predict flash crashes (i.e., 1987).

Backtest results from 1970 to present day shows that this model would have outperformed the S&P 500: 8.06% vs. 7.14% CAGR (trading costs and dividends excluded).

Below is a link to the backtest spreadsheet:

docs.google.com/spreadsheets/d/1oUHet2qhIf0JZoAAcil3gmIgkKU_OBfYUtRq4ObxsTY/edit?usp=sharing

P.S. - I don't know how to code in Pine (yet) so could someone please code this model with the Strategy Tester for me? I would GREATLY appreciate it :) thanks!

------------------------------------------------------------------------

EXPONENTIAL MOVING AVERAGES' SETTINGS

- 1st EMA's length = 10 weeks (50 days)
- 2nd EMA's length = 40 weeks (200 days)

RELATIVE STRENGTH INDEX'S SETTINGS

- Look-back period = 10 weeks (50 days)
- Moving average's length = 40 weeks (200 days)

MODEL'S RULES

Only initiate a new long position when ANY of the following conditions are met:
- MA40(RSI10) > 50
- EMA10 > EMA40

Only exit an existing long position when ALL following conditions are met:
- MA40(RSI10) < 50
- EMA10 < EMA40
algorithmExponential Moving Average (EMA)long-termMomentum Indicator (MOM)Relative Strength Index (RSI)SPX (S&P 500 Index)S&P 500 (SPX500)tactical

Kory Hoang (stably.io)
และใน:

คำจำกัดสิทธิ์ความรับผิดชอบ