Skip to content

RelativeStrengthIndex


class backtide.indicators.RelativeStrengthIndex(period=14)

Relative Strength Index (RSI).

A momentum oscillator that measures the speed and magnitude of recent price changes on a scale of 0 to 100. Values above 70 are typically considered overbought; below 30, oversold. Useful for identifying overbought/oversold conditions, spotting divergences, and confirming trend strength.

Formula:

\[RSI = 100 - \frac{100}{1 + RS}\]

where \(RS = \frac{\text{avg gain over } n}{\text{avg loss over } n}\). Read more on Wikipedia.

Parameters

period : int, default=14

Look-back window length.

Attributes

acronym : str

Short ticker-style acronym.

name : str
Human-readable indicator name.


See Also

CommodityChannelIndex

Commodity Channel Index (CCI).

MovingAverageConvergenceDivergence

Moving Average Convergence Divergence (MACD).

StochasticOscillator

Stochastic Oscillator (STOCH).


Methods

compute Compute the indicator on a dataset.
description Short explanation of what the indicator measures.


method backtide.indicatorscompute(data)

Compute the indicator on a dataset.

Parameters

data : np.ndarray | pd.DataFrame | pl.DataFrame

Historical OHLCV data.

Returns

np.ndarray | pd.Series | pl.Series | pd.DataFrame | pl.DataFrame

The computed values. For multi-output indicators (e.g., upper and lower bounds), return a 2d structure.



method backtide.indicatorsdescription()

Short explanation of what the indicator measures.

Returns

str

The description.