All indicators

2-Period RSI strategy (with filter)

Aug 10, 2019

Static chart image
SignalsOscillatorsMoney ManagementMoving Averages

The 2-Period RSI strategy (with filter) indicator is a backtesting tool designed to execute the mean-reversion strategy popularized by Larry Connors, focusing on short-term oversold conditions within a long-term uptrend.

Usage

The script is primarily used to identify high-probability long entries during market pullbacks. It generates an entry signal when the 2-period RSI drops below a specific threshold (typically 5 or 10) while the price remains above a long-term Simple Moving Average (SMA), such as the 200-period SMA.

An exit signal is triggered when the price closes above a fast moving average, commonly set to 5 or 10 periods. This approach allows traders to capture quick price fluctuations. The strategy is most effective on daily charts and can be tailored to different assets by adjusting the oversold levels and moving average lengths to optimize results.

Details

This implementation includes an optional RSI Moving Average filter to smooth out volatility and reduce false signals. By applying an SMA to the RSI values, the strategy only enters a trade when both the RSI and its moving average are below their respective thresholds. While this may reduce the total number of trades, it often improves the overall quality and profit factor of the signals. Additionally, although the original Larry Connors strategy does not utilize a stop loss to maintain high effectiveness, this script provides an optional percentage-based stop loss for risk management purposes.

Settings

Core Strategy Settings

  • RSI Length: The lookback period for the RSI calculation (default is 2).
  • OverBought Level for RSI: The threshold below which the RSI must fall to trigger a long signal (default is 10).
  • Short MA Length: The period for the fast moving average used as the exit signal (default is 5).
  • Long MA Length: The period for the slow moving average used to define the long-term trend (default is 200).

RSI Filter Settings

  • RSI Moving Average Filter: Enables or disables the smoothing filter for the RSI.
  • RSI Moving Average Length: The period for the SMA applied to the RSI.
  • OverBought Level for the Moving Average of the RSI: The threshold the RSI SMA must be below to allow an entry (default is 30).

Risk Management & Backtest

  • Apply Stop Loss: Toggles the use of a hard percentage-based stop loss.
  • % Stop Loss: The percentage distance from the entry price to place the stop loss.
  • Backtest Period: Date inputs to define the start and end range for the strategy backtest.

FAQ

How do I use the RSI filter effectively?

The filter is designed to reduce noise. Using a length between 4 and 6 for the RSI moving average is often effective for filtering out premature entries in volatile markets.

Why is there no default stop loss?

The original strategy relies on mean reversion, where stop losses can sometimes exit a trade just before the reversal occurs. However, a manual stop loss option is included for users who prioritize capital protection.

How can I access the 2-Period RSI strategy (with filter)?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.