Indicator · Pine Script v6 · Own pane

True RSI

by vedkanani123· code credited to MisinkoMaster

A separate-pane oscillator by MisinkoMaster that rebuilds RSI by weighting each bar's gain and loss with Aroon up and down values over the lookback, then scaling to a 0 to 100 line.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code109
Settings6inputs
LicenceNone statedfile: MPL-2.0
Last update2 months ago23 Aug 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

109 lines of Pine Script v6 from indicator/olg_7_6_26/ALL_2/codex/indicator/6/EMA Crossover Buy/True RSI_34.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

True RSI_34.txt
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MisinkoMaster

//@version=6
indicator("True RSI", "True RSI | MisinkoMaster", overlay = false)
/////////////////////////////////////////////////////////////////////
//Import Libaries
import TradingView/ta/13
/////////////////////////////////////////////////////////////////////
//Get User Defined Inputs
src = input.source(close, "Source",
     group = "True RSI | MisinkoMaster")
len = input.int(21, "Lookback Period", step = 1, minval = 2,
     tooltip = "Changes the lookback for the calculation.",
     group = "True RSI | MisinkoMaster")


ut = input.int(50, "Long Treshold", step = 1,
     tooltip = "Changes the Upper Treshold for RSI Longs",
     group = "Tresholds")
lt = input.int(50, "Short Treshold", step = 1,
     tooltip = "Changes the Lower Treshold for RSI Shorts",
     group = "Tresholds")

obt = input.int(80, "Overbought Treshold", step = 1, minval = 55,
     tooltip = "Changes the Overbought Treshold for catching low value zones",
     group = "Tresholds")
ost = input.int(20, "Oversold Treshold", step = 1, maxval = 45,
     tooltip = "Changes the Oversold Treshold for catching high value zones",
     group = "Tresholds")
/////////////////////////////////////////////////////////////////////
//Calculations
[up, dn] = ta.aroon(len)

gain = math.max(src-src[1], 0)
loss = math.abs(math.min(src-src[1], 0))

tg = 0.0
tl = 0.0
for i = 0 to len-1
    tg += gain[i]*up[i]
    tl += loss[i]*dn[i]
tg := tg/len
tl := tl/len

trs = tg/tl
trsi = 100 - 100 / (1+trs)
c = trsi-trsi[1]
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Trend Logic
var trend = 0

L = trsi > ut
S = trsi < lt

if L
    trend := 1
if S
    trend := -1
////////////////////////////////////////////////////////////////////////////////////////////////////
//Plotting
divergence = 50+c

var col = color.rgb(72, 72, 72)
var colT = color.rgb(72, 72, 72, 50)
if trend == 1
    col := color.rgb(0, 255, 187)
    colT := color.rgb(0, 255, 187, 50)
if trend == -1
    col := color.rgb(255, 0, 157)
    colT := color.rgb(255, 0, 157, 50)

var colD = color.rgb(0, 255, 187, 70)
if divergence > 50
    colD := color.rgb(0, 255, 187, 70)
if divergence < 50
    colD := color.rgb(255, 0, 157, 70)

bc = trsi > obt
sc = trsi < ost

plotshape(trend == 1 and trend[1] != 1 ? src : na, style = shape.labelup, location = location.belowbar, size = size.normal, color = color.rgb(0, 255, 187), display = display.pane, force_overlay = true, text = "𝓛𝓸𝓷𝓰", textcolor = color.rgb(7, 114, 86))
plotshape(trend == -1 and trend[1] != -1 ? src : na, style = shape.labeldown,location = location.abovebar, size = size.normal,color = color.rgb(255, 0, 157), display = display.pane, force_overlay = true, text = "𝓢𝓱𝓸𝓻𝓽", textcolor = color.rgb(95, 11, 63))

var colOB = trsi > obt ? color.rgb(255, 0, 157, 70) : color.rgb(0, 0, 0, 100)
var colOS = trsi > obt ? color.rgb(255, 0, 157, 70) : color.rgb(0, 0, 0, 100)


bgcolor(colOB, force_overlay = true)
bgcolor(colOB, force_overlay = false)
bgcolor(colOS, force_overlay = true)
bgcolor(colOS, force_overlay = false)

lp = plot(ut, title = "Long Treshhold", color = color.rgb(71, 70, 70), display = display.pane, linewidth = 3)
sp = plot(lt, title = "Short Treshhold", color = color.rgb(71, 70, 70), display = display.pane, linewidth = 3)
obp = plot(obt, title = "OB Treshhold", color = color.rgb(0, 255, 187), display = display.pane, linewidth = 3)
osp = plot(ost, title = "OS Treshhold", color = color.rgb(255, 0, 157), display = display.pane, linewidth = 3)

fill(sp, osp, color.rgb(255, 0, 157, 85))
fill(lp, obp, color.rgb(0, 255, 187, 85))
fill(lp, sp, color.rgb(71, 70, 70, 75))

plotcandle(open, high, low, close, bordercolor = col, color = col, force_overlay = true, display = display.pane)

rsip = plot(trsi, "Self-Correcting RSI | MisinkoMaster", color = col, linewidth = 2)
plot(divergence, "Divergence", color = colD, style = plot.style_histogram, histbase = 50)

fill(rsip, obp, colOB)
fill(rsip, osp, colOS)

Overview

Trend turns long when the value crosses above a long threshold and short below a short threshold, both defaulting to 50, with overbought and oversold levels at 80 and 20 that shade the background. Long and short labels mark flips. Source and lookback are adjustable.

Details

Published by

vedkanani123 on GitHub

Code credit

MisinkoMaster, as written in the script's header

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

Oscillators & momentum, Trend

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.

Settings

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

SettingTypeDefaultVariable
Sourcesourceclosesrc
Lookback Periodint21len
Long Tresholdint50ut
Short Tresholdint50lt
Overbought Tresholdint80obt
Oversold Tresholdint20ost
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

Schaff Trend Cycle

by everget
948 stars

This indicator plots the Schaff Trend Cycle in a separate pane. It subtracts a slow exponential moving average from a fast one, applies a stochastic cycle twice, and smooths each result to form a 0–100 oscillator. Line color follows the slope, or the upper and

Indicator v4 Oscillators & momentumTrend
Updated 11 days ago · GPL-3.0 GitHub repository of Schaff Trend Cycle

Beep Boop

by magic8bot
409 stars

This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome

Indicator v4 Oscillators & momentumTrend
Updated 3 years ago · MIT GitHub repository of Beep Boop

[RS]Standardized Trend Map

by ricardosantos79
261 stars

Standardized Trend Map calculates series momentum relative to active price range across 40 distinct lookback periods ranging from 2 to 80 bars on an exponential moving average source. Each standardized calculation rounds to an integer values of -1, 0, or 1 to

Indicator v4 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of [RS]Standardized Trend Map

ADX Histogram

by harryguiacorn
219 stars

This indicator calculates and displays the Average Directional Index (ADX) as a column histogram in a separate pane. It evaluates market trend strength by calculating directional movement metrics based on specified smoothing and DI length inputs. When the ADX

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Histogram
218 stars

Multi-Timeframe Analysis Suite calculates trend direction and momentum conditions across five user-selected timeframes using moving averages, RSI, and Stochastic oscillators. It evaluates moving average slope and oscillator levels to compute trend alignment, m

Indicator v6 Screeners & dashboardsTrend
Updated 3 months ago · None stated GitHub repository of Multi-Timeframe Analysis Suite

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