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
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 14 | min 2, max 5000 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| RSI | Line |
Moves between 0 and 100. Guide lines at 30, 70.
Used in
No strategy template reads it yet.