Relative strength index

rsioscillatorsForge API 1

Momentum bounded 0 to 100, from average gains against average losses.

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint141 to 5000
methodchoicewilder

Outputs

NameTypeRequiredDescription
rsivalueOptionalcolor theme.accent, style line, width 1
Warm-up
period bars (14 at the defaults)
Repaints
No
Parity
TA-Lib, within 1e-9

Formula

gain = the change when it is positive, loss = minus the change when it is negative

wilder: the averages start as the mean of the first period gains and losses, then average = (previous average * (period - 1) + value) / period

cutler: the averages are simple means of the last period gains and losses

RSI = 100 * AvgGain / (AvgGain + AvgLoss)

A window with no gain and no loss reads 50.