RSI Trend Following Strategy
Sep 1, 2024

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.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

