All indicators

RSI Trend Following Strategy

Sep 1, 2024

Static chart image
SignalsOscillatorsMoving AveragesTrailing-StopVolatility

The RSI Trend Following Strategy indicator is a momentum-based trading tool designed to capture trend continuation opportunities by combining the Relative Strength Index (RSI), MACD, and Stochastic oscillators with a long-term trend filter. It aims to identify high-probability long entries when short-term momentum aligns with the primary trend while avoiding overbought conditions.

Usage

The strategy is primarily used to automate or signal long-only entries in trending markets. To trigger an entry, the script requires four conditions to align:

  • RSI: The Relative Strength Index must be above 50, indicating bullish momentum.
  • MACD: The MACD line must be above the signal line.
  • Stochastic: Both %K and %D lines must be below 80 to ensure the asset is not in an overbought state.
  • Trend Filter: The candle low must be above the 200-period EMA to confirm the long-term trend is upward.

Once a position is opened, the strategy manages risk using a dynamic Average True Range (ATR) based stop-loss. Additionally, it features a trailing take-profit mechanism. When the price reaches a specific "Activation Level" (Entry + ATR multiplier), the script begins trailing the position using a dedicated Trailing EMA. If the price closes below this EMA, the trade is closed.

Details

The strategy integrates several technical analysis concepts to provide a comprehensive trade filtering system:

  • Momentum Correlation: By requiring both RSI and MACD to show bullishness, the strategy filters out weak bounces and focuses on established price acceleration.
  • Overbought Prevention: The Stochastic oscillator acts as a safety valve, preventing entries at local peaks where a correction is statistically likely.
  • Volatility-Adjusted Risk: The use of ATR for stop-losses ensures that the strategy adapts to current market volatility, providing wider stops during high volatility and tighter stops during calm periods.
  • Trailing Exit Logic: Unlike fixed target strategies, the trailing EMA allows the trade to remain open during significant trend runs, potentially capturing larger gains than traditional risk-to-reward setups.

Settings

Strategy Settings

  • ATR Stop Loss: The multiplier applied to the ATR to determine the initial and dynamic stop-loss distance.
  • ATR Trailing Profit Activation Level: The multiplier applied to the ATR to set the price point where the trailing EMA exit becomes active.
  • MACD Fast Length: The period for the fast-moving average in the MACD calculation.
  • MACD Slow Length: The period for the slow-moving average in the MACD calculation.
  • MACD Signal Smoothing: The period for the MACD signal line smoothing.
  • Oscillator MA Type: Choose between SMA or EMA for the MACD oscillator lines.
  • Signal Line MA Type: Choose between SMA or EMA for the MACD signal line.
  • RSI Length: The lookback period used for calculating the Relative Strength Index.
  • Trailing EMA Length: The period for the EMA used to trail the price after the profit activation level is hit.

Trading Period Settings

  • Trade Start/Stop Date/Time: Configurable windows to restrict strategy execution to specific historical or future dates.

FAQ

How do I access the RSI Trend Following Strategy?

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

Can this strategy take short trades?

No, the current implementation is designed specifically for long-only trend following to align with major market uptrends.

What timeframe is recommended for this tool?

While it can be optimized for various timeframes, performance is often observed to be more stable on mid-to-high timeframes such as the 2-hour or 4-hour charts.

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.