RSI - colour fill
Aug 16, 2022

The RSI - colour fill indicator provides a visual enhancement to the Relative Strength Index by utilizing dynamic gradient fills to represent momentum and position relative to the center line.
Usage
The RSI - colour fill script is used to visualize the strength of RSI trends through color gradients. Instead of a standard single-color fill, this tool applies a gradient between the RSI level and the 50 center line.
- Bullish Momentum (RSI > 50): The area between the RSI and the 50 level is filled with a gradient. By default, as the RSI moves closer to 80, the color shifts toward the top color (red), and as it moves toward 50, it shifts toward the bottom color (aqua).
- Bearish Momentum (RSI < 50): The area between the RSI and the 50 level shifts between a center color (aqua) and a bottom color (green) as the RSI approaches 20.
Users can use these visual cues to quickly identify overextended conditions or weakening momentum without needing to look at specific numerical values.
Details
This script demonstrates the advanced fill() function capabilities in Pine Script, specifically the ability to use gradients between two plots. The logic defines a dynamic "top" and "bottom" value for the gradient range based on whether the RSI is above or below its midpoint:
- When RSI > 50, the gradient range is fixed between 80 and 50.
- When RSI < 50, the gradient range is fixed between 50 and 20.
The indicator also includes built-in alerts for center-line crossovers, assisting traders in identifying trend shifts.
Settings
RSI Settings
- Length: Determines the lookback period used to calculate the RSI.
RSI > 50
- Top Color: The color the gradient transitions toward as the RSI approaches the 80 level.
- Bottom Color: The color the gradient transitions toward as the RSI approaches the 50 level from above.
RSI < 50
- Top Color: The color the gradient transitions toward as the RSI approaches the 50 level from below.
- Bottom Color: The color the gradient transitions toward as the RSI approaches the 20 level.
FAQ
How do I interpret the gradient colors?
The colors represent the distance of the RSI from the center line (50). The closer the RSI gets to the extreme levels (80 or 20), the more the fill color will transition to the "Top" or "Bottom" primary colors defined in the settings.
Can I change the RSI period?
Yes, you can adjust the "Length" setting in the indicator inputs to match your preferred trading timeframe or strategy requirements.
How can I get access to RSI - colour fill?
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.