RSI is a momentum oscillator that measures the speed and change of price movements. It operates between 0 and 100. This Pine Script V6 version calculates RSI based on closing prices and highlights overbought/oversold levels.
//@version=6
indicator('RSI', overlay=false)
len = input.int(14, 'Length')
src = input.source(close, 'Source')
up = ta.rma(math.max(ta.change(src), 0), len)
down = ta.rma(-math.min(ta.change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, 'RSI', color=color.purple)
hline(70, 'Overbought', color=color.red)
hline(30, 'Oversold', color=color.green)Enhance your trading workflow with these professional tools and platforms.
Keep 100% of the first $12.5K. EOD Drawdown and flexible evaluation types to suit your style.
Secure, reliable, and fully licensed. The best crypto experience for US traders.
The professional's choice for futures trading with minimal slippage and stable API.
Mirror the positions of top-tier traders instantly without writing code.