Open-source scriptindicator/v1
Relative Strength Index
by Kodexius·@kodexius·
Track momentum extremes and RSI crosses with configurable overbought and oversold levels.
#momentum#oscillator#rsi
Open-source script. Everyone can inspect the source code, use the script on a chart, and save an editable copy.
About this script
A clean Relative Strength Index oscillator for spotting momentum extremes and level crosses. Adjust the RSI length and threshold levels to fit the market and timeframe. Alerts are included for entries into the overbought and oversold zones.
Source code
mpl-2.0
// Relative Strength Index with configurable levels
indicator("Relative Strength Index", { overlay: false });
const len = input.number("RSI length", 14, { min: 2, max: 100 });
const overbought = input.number("Overbought", 70, { min: 50, max: 100 });
const oversold = input.number("Oversold", 30, { min: 0, max: 50 });
const value = rsi(close, len);
plot(value, { title: "RSI", color: "#a78bfa" });
hline(overbought, { title: "Overbought", color: "#f87171", overlay: false });
hline(50, { title: "Midline", color: "#64748b", overlay: false });
hline(oversold, { title: "Oversold", color: "#34d399", overlay: false });
alertcondition(crossover(value, oversold), "RSI crossed above the oversold level");
alertcondition(crossunder(value, overbought), "RSI crossed below the overbought level");
Release notes
Initial official release.