RSI Algo (Pinescript v5 + Alerts)
Oct 14, 2021

The RSI Algo indicator provides a systematic approach to identifying potential trend reversals and momentum shifts by analyzing Relative Strength Index (RSI) movements relative to specific overbought and oversold thresholds.
Usage
The indicator can be used to identify trend direction based on the RSI's behavior around the 70 and 30 levels. By default, it signals a "Long" entry when the RSI is rising and crosses the upper threshold, and a "Short" entry when the RSI is falling and crosses the lower threshold.
These signals are visualized via:
- Labels: "Long" and "Short" labels appear on the chart to indicate signal occurrences.
- Lines: Small visual markers appear near the high or low of the bars where signals are triggered.
- Alerts: The script includes built-in alert conditions for both long and short signals to assist with real-time monitoring.
Details
This tool is a refactored version of the RSI Algo Trader, designed to provide cleaner visuals and optimized alert functionality. The core logic monitors the direction of the RSI (rising or falling) in conjunction with threshold crossings.
An "Inverse Algorithm" toggle is available for traders who prefer a contrarian approach. When enabled, the logic flips: buying occurs when the RSI is falling through the lower threshold, and selling occurs when it is rising through the upper threshold. This flexibility allows the tool to be adapted for both trend-following and mean-reversion strategies.
Settings
- Period: Sets the lookback period for the RSI calculation (default is 14).
- Upper Threshold: Defines the overbought level for signal generation (default is 70).
- Lower Threshold: Defines the oversold level for signal generation (default is 30).
- Inverse Algorithm: Toggles between the standard momentum logic and an inverse/mean-reversion logic.
- Show Lines: Enables or disables the visual line markers on the chart.
- Show Labels: Enables or disables the "Long" and "Short" text labels.
FAQ
How do I use the Inverse Algorithm setting? The Inverse Algorithm setting is used to change the signal logic. If you find the standard signals are lagging or you prefer to trade against the immediate momentum at extremes, enabling this will flip the buy/sell triggers.
What timeframe is best for this indicator? The RSI Algo is versatile and can be applied to any timeframe; however, users should adjust the RSI Period and thresholds to match the volatility of the specific asset and timeframe being traded.
How can I access the RSI Algo? 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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.