RPS (relative price strength) is not an indicator that can be calculated for a single stock; it must obtainall stocks in the entire marketSort the price change rate data in the same period. Calculation formula:RPS = (number of outperforming stocks / total number of stocks) × 100. To ensure accuracy, new stocks (stocks listed for less than the period) and suspended stocks must be excluded.
The essence of RPS is apercentile rank (Percentile Rank). Its calculation is divided into three core steps:
Assume the current A-share market has 5000 stocks:
This shows that Guizhou Moutai outperformed 90% of the stocks in the market over the past year.
Many investors try to calculate RPS using Excel or Tongda Xin themselves, often finding that the results do not match William O'Neil's original data. The reason is the following three pitfalls:
Incorrect Approach:Directly using all stocks in the market as the denominator.
Correct Approach:Must exclude new stocks (secondary new stocks) listed for less than N days. For example, to calculate RPS250, exclude stocks listed for fewer than 250 trading days. If not excluded, the continuous limit-up of new stocks will severely pollute the top rankings.
Incorrect Approach:Directly using the original closing prices.
Correct Approach:Must useForward Adjustedprice. At the same time, for stocks that have been suspended for a long time, if they are suspended N days ago, it is necessary to trace back to find the most recent trading day price, or directly exclude it from the sample pool.
Incorrect Approach:N days refer to natural days.
Correct Approach:N days must refer totrading days (Trading Days). RPS250 represents the past 250 trading days (approximately equal to 1 natural years), not the past 250 natural days.
The following is the core logic code (pseudocode) for calculating the RPS of all-market stocks using Python and Pandas:
Although the core algorithm is only a few lines of code, accurately calculating RPS for the global market every day involves a huge workload:
We have handled all the dirty work for you. After the daily close, we automatically update the RPS rankings of 20,000+ stocks in the 5 major cycle across the global market.
View today's RPS ranking immediately →The RPS 20, 50, 120, 250 in our public page are relative strength scores for different observation windows. The higher the value, the better the relative performance of the security in the current available stock pool of the same market.It is used for research screening, not for predicting returns, target prices or buy/sell signals.
In actual research, one should first select the market and observation window, then verify the different window RPS together with volume, fundamentals and liquidity. The complete range, snapshot and limitations are in RPS Methodology。
This site has built four categories of research assets around relative price strength (RPS): methodology, data archives, cross-market rankings, and empirical case studies. The following index covers calculation methodologies, data boundaries, and practical implementation paths, facilitating cross-verification of the data sources and calculation premises underlying the conclusions on this page.
Data snapshot date 2026-08-13. The entire site covers 21,308 securities, 14,807,564 daily records, historical backtracking for each market to 2021-11. Cross-market RPS values cannot be directly compared, see reasons indata overlay file。
Consistent. The calculator and the four-market ranking page use the same criteria: the percentile of the interval gain in the full market sample for the specified period (50/120/250 trading days) is used as the RPS value, ranging from 0 to 99. The benchmark sample is the valid closing data of the day, with 5,212 A-shares, 8,996 US stocks, 2,787 HK stocks, 3,708 Japanese stocks (2026-08-13 snapshot). Therefore, the same security in the calculator and ranking page should get the same result, which can be used for cross-verification.
RPS is a percentile ranking within the market, the denominator is the total number of samples in that market. A-shares have about 5,212 stocks, US stocks about 8,996 stocks. The difference in sample size and industry structure leads to different relative positions represented by the same value. For example, US stock RPS 90 means it outperforms about 8,096 stocks, while A-share RPS 90 means it outperforms about 4,691 stocks. Cross-market comparison should use industry ranking or absolute gains instead.
RPS50 requires at least 50 trading days, RPS120 requires 120, RPS250 requires 250. New stocks with insufficient history cannot calculate long-cycle RPS. The four-market history on our site traces back to 2021 year 11 month (about 1,140 trading days), with a cumulative 14,807,564 daily line records, sufficient to support the complete calculation of three cycles. See the data coverage archive for specific coverage.
William O'Neil suggests screening for stocks with RS greater than 80 in the CANSLIM system. Conventionally, RPS ≥ 90 is considered strong, ≥ 95 is considered very strong. Note that RPS is a lagging indicator, reflecting past relative gains, not predicting future trends; high RPS stocks also have higher drawdown risk and should be used in conjunction with industry distribution, volume and stop-loss discipline.
Supports four markets: A-shares, US stocks, HK stocks and Japanese stocks, covering 21,308 securities; cycles support 50, 120, 250 trading days. A-share data is free and open; US, HK and Japanese stock ranking data require Premium membership. See the RPS Methodology page for calculation methods and standards.
The following table lists the benchmark sample sizes and available periods for the RPS online calculator across four markets. The benchmark sample refers to the number of securities with valid closing prices that can participate in percentile rankings on the day; the securities pool size includes targets that lack sufficient history or are suspended from trading, thus slightly larger than the benchmark sample. Data snapshot date is 2026-08-13.
| Market | Securities pool size | Benchmark sample (daily average) | Industry classification | Available periods | Access permissions |
|---|---|---|---|---|---|
| China A-shares | 5,344 | 5,212 | 47 | 50 / 120 / 250 | Free |
| US stocks | 9,210 | 8,996 | 49 | 50 / 120 / 250 | Premium |
| Hong Kong stocks | 2,819 | 2,787 | 13 | 50 / 120 / 250 | Premium |
| Japanese stocks | 3,721 | 3,708 | 33 | 50 / 120 / 250 | Premium |
| Total | 21,094 | 20,703 | 142 | 3 periods | — |
Calculation criteria andMethodology pagefully consistent; sample boundaries and data sources seedata overlay file; editing standards seeResearch Notes。