Relative Strength Calculator
Calculate the relative strength between two assets to identify potential trading opportunities. Enter the price data below to compute the relative strength ratio and visualize the trend.
How to Calculate Relative Strength: A Comprehensive Guide
Relative strength is a powerful technical analysis tool that compares the performance of two assets to identify which is outperforming the other. This metric is widely used by traders and investors to spot potential trading opportunities, rotate between sectors, and manage portfolio allocations. Unlike absolute performance metrics, relative strength provides context by showing how an asset performs relative to another asset or benchmark.
What Is Relative Strength?
Relative strength measures the price performance of one asset against another over a specific period. It is typically expressed as a ratio or percentage, indicating which asset is stronger (rising faster) or weaker (falling slower or declining more). The concept is rooted in the principle that assets with strong relative strength tend to continue outperforming, while those with weak relative strength tend to underperform.
Key applications of relative strength include:
- Sector Rotation: Identifying which sectors are leading or lagging the broader market.
- Stock Selection: Comparing individual stocks within a sector to find the strongest performers.
- Asset Allocation: Deciding between different asset classes (e.g., stocks vs. bonds).
- Pair Trading: Trading two correlated assets based on their relative performance.
How to Calculate Relative Strength: Step-by-Step
Calculating relative strength involves comparing the price performance of two assets over a defined period. Here’s how to do it:
- Select Two Assets: Choose the assets you want to compare (e.g., SPY vs. QQQ, AAPL vs. MSFT, or BTC vs. ETH).
- Determine the Time Period: Decide the lookback period (e.g., 1 month, 3 months, 1 year). The period should align with your trading horizon.
-
Gather Price Data: Obtain the current and historical prices for both assets at the start and end of the period.
- Current Price of Asset A (PA1)
- Historical Price of Asset A (PA0)
- Current Price of Asset B (PB1)
- Historical Price of Asset B (PB0)
-
Calculate Percentage Changes: Compute the percentage change for each asset over the period.
- Percentage Change for Asset A = ((PA1 – PA0) / PA0) × 100
- Percentage Change for Asset B = ((PB1 – PB0) / PB0) × 100
-
Compute the Relative Strength Ratio: Divide the percentage change of Asset A by the percentage change of Asset B.
- Relative Strength Ratio = Percentage Change of Asset A / Percentage Change of Asset B
-
Interpret the Results:
- Ratio > 1: Asset A is outperforming Asset B.
- Ratio = 1: Both assets are performing equally.
- Ratio < 1: Asset A is underperforming Asset B.
Let’s calculate the relative strength of SPY (S&P 500 ETF) vs. QQQ (Nasdaq-100 ETF) over 6 months:
- SPY: Current Price = $420, Historical Price (6 months ago) = $400
- QQQ: Current Price = $380, Historical Price (6 months ago) = $350
Step 1: Calculate percentage changes:
- SPY: ((420 – 400) / 400) × 100 = 5%
- QQQ: ((380 – 350) / 350) × 100 = 8.57%
Step 2: Compute the ratio:
- Relative Strength Ratio = 5% / 8.57% ≈ 0.58
Interpretation: SPY is underperforming QQQ over the 6-month period (ratio < 1).
Relative Strength vs. Relative Strength Index (RSI)
While both terms include “relative strength,” they refer to different concepts:
| Metric | Definition | Purpose | Range |
|---|---|---|---|
| Relative Strength | Compares the performance of two assets over time. | Identify outperforming/underperforming assets for rotation or allocation. | Unbounded (expressed as a ratio or percentage) |
| Relative Strength Index (RSI) | Measures the speed and change of price movements for a single asset. | Identify overbought/oversold conditions for timing entries/exits. | 0 to 100 (typically 30 = oversold, 70 = overbought) |
Key takeaway: Relative strength is used for comparison between assets, while RSI is used for analyzing a single asset’s momentum.
Practical Applications of Relative Strength
Relative strength is a versatile tool with applications across different trading styles and timeframes. Below are some of the most effective ways to use it:
1. Sector Rotation Strategies
Sector rotation involves shifting capital between sectors based on their relative strength. For example, if the technology sector (represented by QQQ) is outperforming the broader market (SPY), traders may allocate more capital to tech stocks. Conversely, if consumer staples (XLP) are leading, a defensive rotation may be warranted.
| Sector ETF | 6-Month Performance (%) | Relative Strength vs. SPY | Interpretation |
|---|---|---|---|
| QQQ (Tech) | 12.4% | 1.45 | Outperforming |
| XLY (Consumer Discretionary) | 9.8% | 1.18 | Outperforming |
| SPY (S&P 500) | 8.3% | 1.00 | Benchmark |
| XLF (Financials) | 6.2% | 0.75 | Underperforming |
| XLP (Consumer Staples) | 4.1% | 0.49 | Underperforming |
Source: Hypothetical data for illustrative purposes. Real-time data can be obtained from Yahoo Finance or NASDAQ.
2. Stock Selection Within a Sector
Within a sector, relative strength can help identify the strongest stocks. For example, if you’re bullish on technology, you might compare AAPL, MSFT, GOOGL, and AMZN to determine which is leading. The stock with the highest relative strength is often the best candidate for a long position.
3. Asset Allocation Decisions
Investors can use relative strength to allocate between asset classes. For example:
- If stocks (SPY) are outperforming bonds (AGG), increase equity exposure.
- If gold (GLD) is outperforming stocks, consider adding commodities to the portfolio.
- If international markets (EFA) are outperforming U.S. markets (SPY), allocate more to global equities.
4. Pair Trading
Pair trading involves taking a long position in a strong asset and a short position in a weak asset within the same sector. For example, if AAPL is outperforming MSFT, a trader might go long AAPL and short MSFT, betting that the relative outperformance will continue.
Advanced Relative Strength Techniques
While the basic relative strength calculation is straightforward, advanced techniques can enhance its effectiveness:
1. Moving Average Relative Strength
Instead of using a single historical price, calculate the ratio of two moving averages (e.g., 50-day MA of Asset A / 50-day MA of Asset B). This smooths out short-term noise and highlights longer-term trends.
2. Relative Strength Rank
Rank a group of assets (e.g., all S&P 500 stocks) by their relative strength over a period (e.g., 6 months). The top-ranked stocks are candidates for long positions, while the bottom-ranked stocks may be avoided or shorted.
3. Cross-Asset Relative Strength
Compare assets across different classes, such as:
- Stocks vs. Bonds (SPY vs. AGG)
- Stocks vs. Commodities (SPY vs. GLD)
- U.S. Stocks vs. International Stocks (SPY vs. EFA)
This helps identify macro trends, such as risk-on (stocks outperforming bonds) or risk-off (bonds outperforming stocks) environments.
4. Relative Strength with Volatility Adjustment
Adjust the relative strength ratio by the volatility of each asset. For example, if Asset A has a higher relative strength but also higher volatility, the risk-adjusted return may not justify the position. This can be calculated as:
Risk-Adjusted Relative Strength = (Relative Strength Ratio) / (Volatility Ratio)
Where the volatility ratio is the standard deviation of Asset A’s returns divided by the standard deviation of Asset B’s returns.
Common Mistakes to Avoid
While relative strength is a powerful tool, misapplying it can lead to poor decisions. Here are common pitfalls to avoid:
- Ignoring the Timeframe: Relative strength can vary significantly across timeframes. A stock may be strong over 1 month but weak over 1 year. Always align the timeframe with your trading horizon.
- Overlooking Fundamental Factors: Relative strength is a technical tool. Always consider fundamentals (e.g., earnings, valuation) to avoid value traps or overbought assets.
- Chasing Momentum Blindly: Assets with extreme relative strength may be overbought and due for a reversal. Use additional indicators (e.g., RSI, volume) to confirm trends.
- Neglecting Sector/Benchmark Context: A stock may appear strong in isolation but weak relative to its sector or the broader market. Always compare against relevant benchmarks.
- Using Inconsistent Data: Ensure that the price data for both assets is from the same time period and adjusted for splits/dividends to avoid distortions.
Academic Research on Relative Strength
Relative strength is not just a practical tool—it’s also supported by academic research. Studies have shown that momentum-based strategies, including relative strength, tend to outperform over time. Key findings include:
- Jegadeesh and Titman (1993): Found that stocks with strong performance over the past 6–12 months tend to continue outperforming in the subsequent 3–12 months. This is known as the “momentum effect.”
- Asness, Moskowitz, and Pedersen (2013): Demonstrated that momentum strategies work across asset classes, including stocks, bonds, commodities, and currencies.
- O’Shaughnessy (2005): Showed that combining relative strength with fundamental factors (e.g., value, quality) can enhance risk-adjusted returns.
Tools and Resources for Calculating Relative Strength
While you can manually calculate relative strength (as shown in this guide), several tools can automate the process:
- TradingView: Offers a “Relative Strength” indicator that compares two assets. Users can customize the time period and assets.
- StockCharts.com: Provides relative strength tools, including the “Relative Rotation Graphs” (RRG) feature, which visualizes relative strength trends.
- Bloomberg Terminal: Professional traders use the Bloomberg Terminal’s “RS” function to compare assets and create custom relative strength screens.
- Excel/Google Sheets: For DIY investors, spreadsheets can be used to calculate relative strength ratios. Simply input price data and use the formulas provided earlier.
-
Python/R: Programmers can use libraries like
pandas(Python) orquantmod(R) to automate relative strength calculations across large datasets.
Backtesting Relative Strength Strategies
Before implementing a relative strength strategy, it’s critical to backtest it to ensure robustness. Here’s how to approach backtesting:
- Define the Universe: Select the assets you’ll compare (e.g., S&P 500 stocks, sector ETFs).
- Set the Time Period: Choose the lookback period (e.g., 6 months) and the holding period (e.g., 1 month).
- Calculate Relative Strength: For each period, rank assets by their relative strength and select the top performers.
- Simulate Trades: Assume you buy the top assets and hold them for the defined period, then rebalance.
-
Analyze Results: Measure metrics like:
- Annualized return
- Sharpe ratio (risk-adjusted return)
- Max drawdown
- Win rate
- Optimize Parameters: Test different time periods, universes, and ranking methods to find the optimal strategy.
Tools for backtesting include:
- QuantConnect (for algorithmic trading)
- Portfolio Visualizer (for asset allocation)
- TradingView (for manual backtesting)
Case Study: Relative Strength in the 2020–2021 Market
The 2020–2021 market provided a clear example of how relative strength can guide investment decisions. Below is a hypothetical analysis of sector performance during this period:
| Sector ETF | 2020 Performance (%) | 2021 Performance (%) | Relative Strength (2021 vs. SPY) | Notes |
|---|---|---|---|---|
| QQQ (Tech) | 48.9% | 27.1% | 1.23 | Continued leadership in 2021, though with lower momentum than 2020. |
| XLY (Consumer Discretionary) | 33.5% | 25.8% | 1.18 | Strong performance driven by e-commerce and retail. |
| SPY (S&P 500) | 16.3% | 26.3% | 1.00 | Benchmark performance. |
| XLE (Energy) | -37.3% | 53.2% | 2.02 | Massive rebound in 2021 after underperforming in 2020. |
| XLF (Financials) | -2.0% | 34.5% | 1.31 | Strong recovery as interest rates rose. |
| XLP (Consumer Staples) | 8.9% | 10.1% | 0.38 | Underperformed as investors rotated to cyclicals. |
Key Takeaways:
- Energy (XLE) was the strongest sector in 2021, rebounding from severe underperformance in 2020.
- Technology (QQQ) remained strong but showed signs of slowing momentum.
- Consumer staples (XLP) lagged as investors favored cyclical sectors.
- A relative strength strategy would have favored XLE and XLF in 2021.
Frequently Asked Questions (FAQ)
The optimal time period depends on your trading horizon:
- Short-term traders: 1–3 months.
- Swing traders: 3–6 months.
- Long-term investors: 6–12 months.
Avoid periods that are too short (noisy) or too long (may miss trends).
Yes! Relative strength is widely used in crypto to compare:
- Bitcoin (BTC) vs. Ethereum (ETH)
- Major altcoins (e.g., SOL vs. ADA)
- Crypto vs. traditional assets (e.g., BTC vs. SPY)
Crypto markets are highly volatile, so shorter timeframes (e.g., 1–3 months) often work best.
Update frequency depends on your strategy:
- Day traders: Daily or weekly.
- Swing traders: Weekly or biweekly.
- Long-term investors: Monthly or quarterly.
Avoid over-trading based on minor changes in relative strength.
Final Thoughts
Relative strength is a timeless tool that helps traders and investors identify trends, rotate between assets, and manage risk. By comparing the performance of two assets, you can:
- Spot emerging trends before they become obvious.
- Avoid underperforming assets and focus on leaders.
- Improve timing for sector rotation and stock selection.
- Enhance risk-adjusted returns by combining relative strength with other factors (e.g., value, momentum).
Like any tool, relative strength is most effective when used in conjunction with other analysis methods. Combine it with fundamental research, risk management, and discipline to build a robust trading or investing strategy.
For further reading, explore these authoritative resources:
- U.S. Securities and Exchange Commission (SEC) — Regulatory insights for traders.
- SEC’s Office of Investor Education — Educational resources on technical analysis.
- Federal Reserve Economic Data (FRED) — Macroeconomic data that can contextually support relative strength analysis.