Relative strength index
All indicators

LibraryMomentum

Indicator

Relative strength index

How strongly the recent closes rose against how strongly they fell, on a scale from 0 to 100.

MomentumOwn pane2 inputsRSI

How it is calculated

Each bar's rise and fall are averaged with Wilder's smoothing over the length, the first average being the plain mean of the first changes. RSI is 100 minus 100 divided by one plus the average rise over the average fall; with no falls at all it is 100.

Reference: TA-Lib RSI (Wilder 1978)

How to read it

Above 70 the market is often called overbought, below 30 oversold. In a strong trend RSI can stay there for a long time, so a turn back across the line says more than the level itself.

In a strategy

A mean reversion entry when RSI crosses back above 30: ctx.ind("rsi", length=14) read each bar and compared with the value a bar earlier, or as a filter that only allows longs while it is below 70.

Inputs

InputTypeDefaultRange or choices
LengthlengthWhole number14min 2, max 5000
SourcesourcePrice"close"close, open, high, low, hl2, hlc3, ohlc4, hlcc4

What it draws

LineDrawn as
RSILine

Moves between 0 and 100. Guide lines at 30, 70.

Used in

No strategy template reads it yet.

OrionQuant