All indicators

Strategy MACD and RSI alert

Jan 2, 2015

Static chart image
SignalsOscillatorsMoving Averages

The Strategy MACD and RSI alert indicator is a trend-following tool designed to identify potential market entry points by combining momentum and oscillator data. By analyzing the relationship between the Moving Average Convergence Divergence (MACD) and the Relative Strength Index (RSI), the tool provides clear visual signals for long and short biases.

Usage

The indicator can be used to identify trend shifts based on the convergence of momentum and overbought/oversold conditions. A long signal is generated when the RSI exceeds the overbought threshold while the MACD line is above its signal line. Conversely, a short signal is triggered when the RSI falls below the oversold threshold while the MACD line is below its signal line.

Users can monitor the bar colors on the chart to identify current market sentiment:

  • Green Bars: Indicate a bullish (Long) position bias.
  • Red Bars: Indicate a bearish (Short) position bias.
  • Blue Bars: Indicate a neutral or transition state.

Details

The script executes logic based on two primary technical components:

  1. MACD: It calculates the difference between a fast and slow Exponential Moving Average (EMA). A signal line (SMA of the MACD) is then used to determine the momentum direction.
  2. RSI: A standard Relative Strength Index is calculated to gauge price velocity and magnitude.

The "Position" (pos) logic is sticky, meaning the indicator maintains its last state until the opposing criteria are met. This prevents flickering signals and provides a smoother trend representation. Alerts are specifically optimized to trigger only upon the initial change of the trend state (bar color change), ensuring users are not spammed with repetitive notifications during a single trend leg.

Settings

MACD Settings

  • MACD Fast Length: The period for the shorter-term EMA used in MACD calculation.
  • MACD Slow Length: The period for the longer-term EMA used in MACD calculation.
  • MACD Signal Length: The period for the smoothing average (SMA) of the MACD line.

RSI Settings

  • RSI Length: The lookback period used to calculate the Relative Strength Index.
  • RSI Oversold: The threshold level used to determine bearish entry criteria.
  • RSI Overbought: The threshold level used to determine bullish entry criteria.

FAQ

How do I access the Strategy MACD and RSI alert?

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

What do the bar colors signify?

Green bars represent a bullish signal triggered by RSI and MACD alignment, while red bars represent a bearish signal. Blue bars represent the default or initial state before a signal is generated.

Does this indicator provide alerts?

Yes, the indicator includes built-in alert functionality that triggers specifically when the position status changes from neutral/short to long or neutral/long to short.

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.