Docs

ta.rsi

Gauge overbought and oversold conditions on a 0 to 100 scale from recent gains and losses.

itm
ta.rsi(source, length)

Relative Strength Index over Wilder's smoothing of gains and losses. Seeded with the simple average of the first length changes, which is the canonical Wilder seed.

Parameters

A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.

NameKindTypeDefaultRangeDescription
sourceSeriesnumber--The series to read.
lengthConstantnumber141 to 10000Window in observed bars.

Output

NameType
valuenumber

Warm-up and missing values

Warm-up
length + 1 bars. Names in the warm-up are this operator’s parameters.
Missing values
na until length+1 observations have been seen (the first change needs two bars, then the smoothing needs a full window). A flat window with no losses returns 100.

Example

itm
ta.rsi(close, 14)
itm
rsi = ta.rsi(close, 14)
plot(rsi, "Strength 14")
hline(70, "Overbought")