All indicators

MACD crossover while RSI Oversold/Overbought

Nov 10, 2025

Static chart image
Support and ResistanceSignalsOscillatorsDrawing ToolMoving Averages

The MACD crossover while RSI Oversold/Overbought indicator provides a systematic approach to identifying trend reversals by combining momentum and exhaustion signals from two primary technical analysis tools. It identifies high-probability entry points by ensuring that MACD crossovers only trigger when the market has recently reached extreme RSI levels.

Usage

The indicator can be used to identify potential mean-reversion opportunities in various market conditions. It generates two primary visual signals on the chart:

  • Long Signal (Green Triangle): Appears below the candle when a bullish MACD crossover occurs and the RSI was recently in the oversold zone (≤29). A green dashed line is extended from the low of this candle to act as a potential support level.
  • Short Signal (Red Triangle): Appears above the candle when a bearish MACD crossover occurs and the RSI was recently in the overbought zone (≥71). A red dashed line is extended from the high of this candle to act as a potential resistance level.

Users can utilize the dashed lines for stop-loss placement or to identify areas of interest for future price action. Only the most recent support and resistance lines are displayed to maintain chart clarity.

Details

This script implements a "memory" logic for the RSI condition. Instead of requiring the RSI to be in an extreme zone at the exact moment of the MACD cross, it looks back over the previous 5 candles. This accounts for the common scenario where price momentum shifts (causing the MACD cross) after the initial RSI peak or trough has already passed.

The script uses standard calculations for:

  • RSI: Calculated using the Relative Moving Average (RMA).
  • MACD: Consists of the difference between the Fast and Slow Moving Averages, compared against the Signal Line.
  • Dynamic Levels: Automatically manages line objects to delete previous levels and project new ones when signals appear.

Settings

MACD Parameters

  • Fast moving average: The period for the shorter-term exponential moving average (Default: 12).
  • Slow moving average: The period for the longer-term exponential moving average (Default: 26).
  • Signal Length: The smoothing period for the MACD signal line (Default: 9).

RSI Parameters

  • RSI Length: The lookback period for the RSI calculation (Default: 14).
  • RSI Oversold Level: The threshold below which the market is considered oversold (Default: 29).
  • RSI Overbought Level: The threshold above which the market is considered overbought (Default: 71).

FAQ

How do I access the MACD crossover while RSI Oversold/Overbought indicator?

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

Why does a signal disappear or move?

The signals are confirmed on the close of the candle. While a candle is active (real-time), the crossover may happen and then un-happen before the bar closes.

Can I change the sensitivity of the signals?

Yes, by reducing the MACD Fast/Slow MA periods or adjusting the RSI thresholds (e.g., moving from 29/71 to 30/70), you can increase the frequency of signals, though this may also increase market noise.

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.