RSI and MACD Reversal Signal
Jun 5, 2019

The RSI and MACD Reversal Signal indicator identifies potential bullish reversals by combining oversold Relative Strength Index (RSI) conditions with Moving Average Convergence Divergence (MACD) crossovers to pinpoint high-probability entry and exit points.
Usage
The indicator is designed to filter MACD signals using historical RSI context. A "BUY" signal is generated when the MACD line crosses above the signal line, provided that the RSI has dipped below a specified threshold (default 30) within a certain lookback period. This ensures that bullish momentum is being captured following an oversold condition. Conversely, a "SELL" signal is triggered when the MACD line crosses back below the signal line, suggesting the bullish momentum has dissipated.
Traders can use these signals to:
- Identify potential trend reversals after a period of selling pressure.
- Filter out premature MACD crossovers that lack prior oversold confirmation.
- Manage exits using the bearish MACD crossover logic.
Details
The script monitors the relationship between two classic momentum oscillators. It tracks the number of bars since the RSI last crossed under the threshold. If a bullish MACD crossover occurs while this "bars since" count is within the user-defined maximum lookback, a buy signal is validated. The logic also ensures that the buy signal is only valid if a sell signal hasn't already occurred since the RSI was oversold, maintaining a logical flow of trade states.
Settings
- RSI Period: The lookback length used for the RSI calculation (default 14).
- RSI Source: The price data source for RSI calculation.
- RSI Threshold: The level used to define the oversold condition (default 30).
- Plot Buy Line: Toggle to display a binary plot for buy signals, useful for external alert configurations.
- Plot Sell Line: Toggle to display a binary plot for sell signals, useful for external alert configurations.
- MACD Fast Period: The short-term EMA period for MACD.
- MACD Slow Period: The long-term EMA period for MACD.
- MACD Signal Smoothing: The period for the MACD signal line (SMA).
- Maximum Candle Lookback: The maximum number of bars allowed between the RSI oversold event and the MACD crossover for a signal to remain valid.
FAQ
How do I access the RSI and MACD Reversal Signal?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Can I change the sensitivity of the signals?
Yes, by adjusting the RSI Period or the MACD Fast/Slow periods, you can make the indicator more or less responsive to price movements.
Does this indicator repain?
No, the signals are calculated based on bar closes and do not repaint once the candle has closed.
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.