Relative Strength Index (RSI)
Calculate the Relative Strength Index (RSI) indicator for a given price series.
The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. It ranges from 0 to 100 and is used to identify overbought or oversold conditions in an asset’s price.
The formula is as follows:
\[\text{RSI} = 100 - (100 / (1 + \text{RS}))\]Readings above 70 are conventionally read as overbought and below 30 as oversold, but in a strong trend the RSI can stay above 70 or below 30 for weeks, so a crossing is not a signal on its own. Practitioners look more at divergences, a new price high with a lower RSI high, and at the 50 line as a trend filter. The value depends on the window: a shorter window swings more and reaches the extremes more often.
Also known as: RSI, momentum oscillator, overbought, oversold.
Relative Strength Index (RSI) in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_relative_strength_index as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
tickers=["BTCUSD", "ETHUSD"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.technicals.get_relative_strength_index().tail(5)
Or, after setting up the Finance Toolkit MCP, ask:
Were Bitcoin and Ether overbought or oversold at any point from 27 to 31 December 2025, judging by their 14-day relative strength index?
Which returns:
| Date | BTCUSD | ETHUSD | Benchmark |
|---|---|---|---|
| 2025-12-27 | 44.6846 | 45.0659 | 62.972 |
| 2025-12-28 | 44.9649 | 45.241 | 61.2128 |
| 2025-12-29 | 42.4043 | 44.276 | 59.4252 |
| 2025-12-30 | 47.7803 | 47.2561 | 57.5773 |
| 2025-12-31 | 44.643 | 46.9887 | 47.8313 |
Parameters
get_relative_strength_index accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”. | "weekly" |
close_column | str | The column name for closing prices in the historical data. Defaults to “Adj Close”. | "Close" |
window | int | The number of periods for RSI calculation. Defaults to 14. | 20 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the RSI. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |