The S&P500 Advanced RSI Indicator Trading Strategy is a medium to long term trend following strategy for trading the S&P500 index. This strategy combines multiple filters with RSI overbought and oversold signals to control risk and reduce false signals.
The core indicator of this strategy is RSI, using 2 period RSI to determine price overbought and oversold levels. It goes long when RSI drops below the oversold line and closes position when RSI rises above the overbought line. In addition, the strategy has a series of auxiliary filters to control risk:
Weekly RSI Filter: Requires weekly RSI to be below a threshold to avoid overly aggressive longs in a bull market.
MA Filter: Requires price to be above a certain MA period to ensure entering after an uptrend has started.
Secondary RSI Filter: Requires the secondary RSI indicator also drops below oversold line to avoid false breakouts.
ATR Breakout Filter: Avoids going long after a sharp price drop to control risk.
The combination of these multiple filters can effectively identify medium to long term price reversal points, control trade frequency and reduce risk.
The S&P500 Advanced RSI Indicator Trading Strategy has the following advantages:
Combining multiple auxiliary indicators reduces false signals and improves reliability.
The ATR breakout filter controls risk by avoiding buying after a price crash.
Weekly RSI filter prevents overly aggressive longs in a bull market.
MA filter ensures entering after an uptrend has started.
Secondary RSI filter avoids false RSI breakouts.
Suitable for medium to long term holding and avoids overtrading.
The main risks of this strategy come from the following aspects:
RSI as the main indicator has some lagging.
Filter conditions could be too strict and miss opportunities.
Stop loss could be taken out during flash crashes.
Simple RSI and filters have limited capabilities in complex market conditions.
Corresponding mitigations:
Adjust parameters to avoid missing trades.
Increase position sizing to account for some missed trades.
Relax filter conditions moderately to increase trade frequency.
Consider combining more indicators for complex market analysis.
The strategy can be further optimized in the following directions:
Test adjusting RSI parameters to find optimal overbought/oversold lines.
Test MA period parameters to determine optimal values.
Test adjusting ATR parameters to optimize price breakout filters.
Try combining other indicators for better analysis of complex markets.
Optimize weekly RSI parameters to find optimal settings.
Optimize secondary RSI parameters including period and overbought/oversold lines.
The S&P500 Advanced RSI Indicator Trading Strategy identifies medium to long term trend reversal points using RSI and multiple filter conditions to control risk. It utilizes the strengths of RSI effectively to lock in medium/long term trends and avoid overtrading. As parameters continue to be optimized, strategy performance can continue improving. Overall it is suitable for medium to long term value investing and is a relatively stable quantitative strategy.
/*backtest start: 2024-01-06 00:00:00 end: 2024-02-05 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 // Lets connect on LinkedIn (https://www.linkedin.com/in/lets-grow-with-quality/) // Optimized for S&P500 Daily. Use it as a buy confirmation on certain levels (Springs, Pullbacks, ...) or let it run // without "Weekly RSI Filter" and pyramiding for 4 x more trades. // This strategy is optimized for minimum drawdowns and has several filters on board for use on different securities strategy("S&P500 RSI2 Studio", overlay=true) baseLength = input(2, title="Base RSI Length") overSold = input(10, title="Overbought Level") overBought = input(90, title="Oversold Level") overBoughtExit = input(70, title="Overbought Level Exit") enableWeeklyRsiFilter = input(true, title="Enable Weekly RSI Filter") weeklyOverSold = input(30, title="Weekly Oversold Level") weeklyOverBought = input(70, title="Weekly OverOverbought Level") weeklyRsiLength = input(2, title="weeklyRsiLength") enableWmaFilter = input(false, title="Enable MA Filter") wmaLength = input(100, title="WMA Length") exitRsiLength = input(4, title="Exit RSI Length") dailyRsiLength = input(4, title="Daily RSI Length") enable2ndRSIFilter = input(false, title="Enable 2nd RSI Filter") SecRSIFilterLengh = input(14, title="2nd RSI Filter Length") SecRSIFilterOverSold = input(20, title="2nd RSI Filter Oversold Level") enableAtrFilter = input(true, title="Enable ATR Filter") numAtrDays = input(14, title="Number of Days ATR Average") atrFilterFactor = input(2, title="ATR Filter Factor") weeklyRsi = request.security(syminfo.tickerid, "W", ta.wma(ta.rsi(close, weeklyRsiLength), 1)) exitRsi = request.security(syminfo.tickerid, "D", ta.wma(ta.rsi(close, exitRsiLength), 2)) dailyRsi = request.security(syminfo.tickerid, "D", ta.wma(ta.rsi(close, dailyRsiLength), 2)) price = close priceDropCondition = ta.atr(1) >= ta.atr(numAtrDays) * atrFilterFactor preventEarlyEntry = not priceDropCondition vrsi = ta.wma(ta.rsi(price, baseLength), 2) wma = ta.wma(price, wmaLength) buyCond1 = ta.crossunder(vrsi, overSold) buyCond2 = enableWeeklyRsiFilter ? weeklyRsi < weeklyOverSold : true buyCond3 = enable2ndRSIFilter ? ta.wma(ta.rsi(close, SecRSIFilterLengh),2) < SecRSIFilterOverSold : true buyCond4 = enableWmaFilter ? price > ta.wma(close, wmaLength) : true buyCond5 = enableAtrFilter ? preventEarlyEntry : true buy = buyCond1 and buyCond2 and buyCond3 and buyCond4 and buyCond5 if (not na(vrsi)) if buy strategy.entry("RSI2 Studio", strategy.long, comment="Long") if (exitRsi > overBoughtExit) strategy.close("RSI2 Studio", comment="Close Long")