RSI & MACD
Apr 25, 2021

The RSI & MACD indicator combines two of the most popular momentum oscillators into a single pane to provide a comprehensive view of trend strength and reversal points. This tool allows traders to monitor both Relative Strength Index (RSI) levels and MACD momentum shifts simultaneously without cluttering the chart with multiple windows.
Usage
The Usage section focuses on identifying confluence between momentum and trend. Traders can use this tool to look for overbought or oversold conditions via the RSI while confirming potential entry or exit points using MACD crossovers. For example, an RSI crossing above 30 combined with a bullish MACD crossover (MACD line crossing above the signal line) can serve as a strong signal of a trend reversal.
The indicator is also useful for spotting divergences. If price makes a new high but the RSI and MACD peaks are lower, it may indicate weakening momentum. Conversely, higher lows in the indicator during new price lows suggest potential upward momentum.
Details
To resolve the scale disparity between RSI (which ranges from 0-100) and MACD (which is based on price differences), this script applies a normalization calculation. The MACD values are multiplied by 1,000 and then divided by the current price. This transformation effectively "squeezes" the MACD data into a range that is compatible with the RSI scale, allowing both to be visualized and compared effectively in one window.
Settings
The settings are split into RSI and MACD configurations:
- Length RSI: Sets the lookback period for the RSI calculation (default is 9).
- Source RSI: Determines the price data used for RSI (default is Close).
- Fast Length MACD: The period for the shorter-term Moving Average in the MACD calculation.
- Slow Length MACD: The period for the longer-term Moving Average in the MACD calculation.
- Source MACD: Determines the price data used for MACD calculations.
- Signal Smoothing: The lookback period for the MACD Signal line.
- Simple MA (Oscillator): If enabled, uses a Simple Moving Average instead of an Exponential Moving Average for the MACD line.
- Simple MA (Signal Line): If enabled, uses a Simple Moving Average for the Signal line.
FAQ
How do I interpret the colors on the Histogram?
The histogram colors change based on whether momentum is increasing or decreasing relative to the zero line. Dark green/red represent strengthening momentum, while lighter shades represent weakening momentum.
Can I change the RSI levels?
While the levels are visually set at 70 and 30, the script includes alerts for when these levels are crossed, which can be modified within the alert menu.
How do 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.