Relative Strength
Calculate the relative strength of every ticker against the Benchmark and against the other tickers. Relative strength investing buys what has been outperforming, the momentum effect that has held across markets and decades.
- Relative Strength: the price divided by the Benchmark’s, set to 1 on the first date. It rises while the ticker outperforms the Benchmark.
- Mansfield Relative Strength: the relative strength against its own moving average (of
windowperiods, a year by default) minus 1. Above zero the ticker is gaining on the Benchmark. - Relative Strength Rating: the ticker’s performance over the last year, the last quarter weighing most (the 3, 6, 9 and 12-month returns weighted 0.4, 0.2, 0.2 and 0.2), ranked against the other tickers from 1 (weakest) to 99 (strongest), from daily prices. Investor’s Business Daily publishes the original rating with a proprietary formula; this weighting is its common public approximation. Tickers with the same score share the highest rank among them, so the rating reads as the share of the other tickers outperformed or matched and tied leaders both rate 99. It needs many tickers to be meaningful, such as the constituents of an index (see
Discovery.get_index_constituents, whose current members leave out the companies removed from the index since).
For more information, see the following papers and books:
- Jegadeesh, N. and Titman, S. (1993). “Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency.” The Journal of Finance, 48(1), 65-91.
- Weinstein, S. (1988). “Stan Weinstein’s Secrets for Profiting in Bull and Bear Markets.” McGraw-Hill.
- O’Neil, W.J. (1988). “How to Make Money in Stocks.” McGraw-Hill.
Also known as: relative strength, price relative, Mansfield relative strength, RS rating, relative performance.
Relative Strength in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_relative_strength as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT", "NVDA", "AMZN", "GOOGL"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2022-01-01",
end_date="2025-12-31",
)
relative_strength = toolkit.technicals.get_relative_strength()
relative_strength["Relative Strength Rating"].tail()
Or, after setting up the Finance Toolkit MCP, ask:
How did Apple, Microsoft, Nvidia, Amazon and Alphabet score on the 1-99 relative strength rating from 24 to 31 December 2025, based on prices from 2022?
Which returns:
| Date | AAPL | MSFT | NVDA | AMZN | GOOGL |
|---|---|---|---|---|---|
| 2025-12-24 | 50 | 1 | 74 | 26 | 99 |
| 2025-12-26 | 50 | 1 | 74 | 26 | 99 |
| 2025-12-29 | 50 | 1 | 74 | 26 | 99 |
| 2025-12-30 | 50 | 1 | 74 | 26 | 99 |
| 2025-12-31 | 50 | 1 | 74 | 26 | 99 |
Parameters
get_relative_strength accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The time period to consider for historical data. Can be “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”. | "weekly" |
close_column | str | The name of the column containing the close prices. Defaults to “Adj Close”. | "Close" |
window | int | None | The moving average window of the Mansfield relative strength, in periods. Defaults to None, which uses a year of periods: 252 daily, 52 weekly, 12 monthly, 4 quarterly and 1 yearly (a single period, which makes the measure zero, so pass a longer window for yearly data). | 20 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit. | 2 |