Indicator · Pine Script v6 · Own pane

Relative Liquidity Index

by InNoobWeTrust

The Relative Liquidity Index measures market volatility and liquidity dynamics by calculating the Relative Strength Index (RSI) of the Average True Range (ATR).

View on GitHub

GitHub stars4on the repository
Pine versionv6current
Lines of code46
Settings8inputs
LicenceNone statedfile: MPL-2.0
Last updatetoday28 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

46 lines of Pine Script v6 from .innoobwetrust/life_hacks/tradingview/relative_liquidity_index.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

relative_liquidity_index.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © InNoobWeTrust

//@version=6
indicator("Relative Liquidity Index", overlay = false)

//===============================================================================
// Functions
//===============================================================================
relative_liquidity_index(int atr_len, int rli_len) =>
    atr = ta.atr(atr_len)
    rli = ta.rsi(atr,rli_len)
    // Return the RLI
    rli

//===============================================================================
// Input
//===============================================================================
atr_len = input.int(34,'ATR length')
rli_len = input.int(14,'Relative Liquidity Index length')
low_liquidity_threshold = input.float(20,'Low liquidity threshold',minval=0,maxval=50)
high_liquidity_threshold = input.float(80,'High liquidity threshold',minval=50,maxval=100)
low_liquidity_color = input.color(color.new(color.maroon,80),'Low liquidity area color')
high_liquidity_color = input.color(color.new(color.teal,80),'High liquidity area color')
show_chart_background = input.bool(false,'Show gradient background on chart')
no_background_till_thresholds = input.bool(true, "No background color until threshold exceeded")
//===============================================================================
// Calculation
//===============================================================================
rli = relative_liquidity_index(atr_len,rli_len)
low_liquidity_area_color = rli <= low_liquidity_threshold ? low_liquidity_color : na
high_liquidity_area_color = rli >= high_liquidity_threshold ? high_liquidity_color : na
rli_color = color.from_gradient(rli,0,100,low_liquidity_color,high_liquidity_color)
rli_bg_color = not no_background_till_thresholds or (rli <= low_liquidity_threshold or rli >= high_liquidity_threshold) ? rli_color : color(na)

//===============================================================================
// Plot
//===============================================================================
rli_plt = plot(rli, 'Relative Liquidity Index',color = color.new(rli_color,0),linewidth = 2,force_overlay = false)
low_liquidity_plt = hline(low_liquidity_threshold,'Low liquidity threshold',linestyle = hline.style_dashed,color=color.new(color.red,50))
high_liquidity_plt = hline(high_liquidity_threshold,'High liquidity threshold',linestyle = hline.style_dashed,color=color.new(color.green,50))

plot(rli,'Time of low liquidity',low_liquidity_area_color,style = plot.style_area,histbase = low_liquidity_threshold)
plot(rli,'Time of high liquidity',high_liquidity_area_color,style = plot.style_area,histbase = high_liquidity_threshold)

bgcolor(show_chart_background ? rli_bg_color : color(na),force_overlay = true)

Overview

Displayed in a separate pane, it highlights low and high liquidity states based on configurable threshold levels. Users can customize the ATR and RSI lengths, threshold limits, and background shading options, including an optional color gradient on the main price chart when thresholds are crossed.

Details

Published by

InNoobWeTrust on GitHub

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

Volatility & bands, Oscillators & momentum

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

dotfiles

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
ATR lengthint34atr_len
Relative Liquidity Index lengthint14rli_len
Low liquidity thresholdfloat20low_liquidity_threshold
High liquidity thresholdfloat80high_liquidity_threshold
Low liquidity area colorcolorcolor.new(color.maroon,80)low_liquidity_color
High liquidity area colorcolorcolor.new(color.teal,80)high_liquidity_color
Show gradient background on chartboolfalseshow_chart_background
No background color until threshold exceededbooltrueno_background_till_thresholds
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

TTM Squeeze

by Alorse
330 stars

This indicator plots a TTM Squeeze momentum oscillator in a separate pane. It compares a Bollinger Band offset to a Keltner Channel offset and marks the zero line white when the difference is non-negative and black when the bands are inside the channel. A line

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of TTM Squeeze

Function - Logistic Equation

by ricardosantos79
261 stars

Calculates dynamic modeling values by applying a mathematical logistic differential equation to price change over a specified lookback length. It measures price momentum relative to the recent high-low price range. The script plots positive and negative logist

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 years ago · None stated GitHub repository of Function - Logistic Equation

MACD-V

by harryguiacorn
219 stars

MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of MACD-V
218 stars

This indicator detects a Bollinger Band squeeze when the bands sit inside Keltner Channels, marking low volatility. It plots red dots during a squeeze and green dots when the bands are outside, in a separate pane. An optional histogram shows momentum as the cl

Indicator v6 Volatility & bandsOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Bollinger Band Squeeze Detector
147 stars

This indicator generates trade entry signals and target levels optimized for 1-hour timeframes, designed for external signal extraction. It calculates 7-period and 16-period EMAs alongside 10-period RSI and ATR filters. Long signals occur when the fast EMA cro

Indicator v5 TrendOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of Signal Strategy 100 Candles of 1H Timeframe

Bubbles Indicator

by capissimo
114 stars

The Bubbles Indicator measures volatility squeezes and expansion bursts using Bollinger Bands combined with a sinusoid oscillator and RSI divergence. It processes price data through scaled Bollinger Bands to highlight volatility changes while confirming trend

Indicator v4 Volatility & bandsOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Bubbles Indicator

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers