RSI + MACD
May 28, 2020

The RSI + MACD indicator combines two of the most widely used momentum oscillators into a single interface to help traders identify trend direction and potential reversals through divergence detection.
Usage
The script is designed primarily for intraday trading and scalping on lower timeframes (such as the 3-minute chart or lower). It provides a multi-layered approach to market analysis:
- Trend Confirmation: A common strategy involves looking for long opportunities when the RSI is above 60 and the MACD histogram is above the zero line. Conversely, short opportunities are sought when the RSI is below 40 and the MACD is below the zero line.
- Divergence Signals: The indicator automatically identifies and labels four types of divergences between price and the RSI: Regular Bullish, Hidden Bullish, Regular Bearish, and Hidden Bearish. These labels appear on the oscillator pane to signal potential exhaustion or trend continuation.
- Crossover Analysis: Traders can monitor the MACD line and Signal line for crossovers, which serve as additional momentum confirmation alongside the RSI levels.
Details
This tool integrates a modified Relative Strength Index (RSI) with a Moving Average Convergence Divergence (MACD) oscillator. The RSI component includes logic to detect pivot points and compare them with price action to identify divergences. The MACD component provides a histogram and signal line using customizable moving average types (EMA or SMA). By layering these two indicators, the script aims to filter out noise and highlight high-probability setups where both momentum and strength align.
Settings
RSI Divergences
- RSI Period: Sets the number of bars used for the RSI calculation.
- RSI Source: Determines the price data used for the RSI (e.g., Close, Open).
- Pivot Lookback Right/Left: Adjusts the number of bars required to confirm a pivot high or low for divergence detection.
- Max/Min of Lookback Range: Defines the bar range window in which a divergence must occur to be valid.
- Plotting Options: Toggle visibility for Regular Bullish, Hidden Bullish, Regular Bearish, and Hidden Bearish signals.
MACD
- Fast/Slow Length: Controls the periods for the fast and slow moving averages.
- Signal Smoothing: Sets the length for the signal line's moving average.
- Simple MA (Oscillator): When enabled, uses SMA instead of EMA for the MACD calculation.
- Simple MA (Signal Line): When enabled, uses SMA instead of EMA for the signal line smoothing.
FAQ
How do I use this for scalping? On small timeframes like 1m or 3m, look for instances where RSI crosses 60 with a positive MACD for buys, or RSI crosses below 40 with a negative MACD for sells.
What do the "Hidden" divergence labels mean? Hidden divergences typically suggest trend continuation. For example, a Hidden Bullish divergence during an uptrend suggests the trend is likely to persist.
How can I access RSI + MACD? 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.