Documentation/AlgoCode/Function reference

rsi

Relative Strength Index

Reference/Oscillators/Function

rsi(source, length)

Wilder RSI, 0–100. Overbought near 70, oversold near 30. Short form `rsi(14)` uses close.

Parameters

NameTypeDescription
sourceoptionalseries
default close
Series to use. Omit it when the first argument is a number — ema(9) means ema(close, 9).
lengthint
default 14
Lookback in bars. Default 14.

Return value

series

Short form: if the first argument is a number, Dovee uses close as the source.

Example

oscillator
length = input 14 as "RSI Length"
os = input 30 as "Oversold"
ob = input 70 as "Overbought"
r = rsi(close, length)
plot r as "RSI" purple
level 70 as "Overbought" red
level 30 as "Oversold" green
when r is below os then buy
when r is above ob then exit

See also