OPEN-SOURCE SCRIPT
Relative Performance Analyzer [AstrideUnicorn]

Relative Performance Analyzer (RPA) is a performance analysis tool inspired by the data comparison features found in professional trading terminals. The RPA replicates the analytical approach used by portfolio managers and institutional analysts who routinely compare multiple securities or other types of data to identify relative strength opportunities, make allocation decisions, choose the most optimal investment from several alternatives, and much more.
Key Features:
Practical Use Cases:
Example Scenarios:
HOW DOES IT WORK
The indicator calculates and visualizes performance from a user-defined starting point using two methodologies:
HOW TO USE
SETTINGS
Assets 1-5: Toggle on/off and input symbols for comparison (stocks, ETFs, indices, forex, crypto, fundamental data, etc.)
Start Date: Set the initial point for return calculations (drag on chart or input manually)
Return Type: Choose between "Percentage" or "Risk-Adjusted" performance.
Key Features:
- Multi-Symbol Comparison: Track up to 5 different symbols simultaneously across any asset class or dataset
- Two Performance Calculation Methods: Choose between percentage returns or risk-adjusted returns
- Interactive Analysis: Drag the start date line on the chart or manually choose the start date in the settings
- Professional Visualization: High-contrast color scheme designed for both dark and light chart themes
- Live Performance Table: Real-time display of current return values sorted from the top to the worst performers
Practical Use Cases:
- ETF Selection: Compare similar ETFs (e.g., SPY vs IVV vs VOO) to identify the most efficient investment
- Sector Rotation: Analyze which sectors are showing relative strength for strategic allocation
- Competitive Analysis: Compare companies within the same industry to identify leaders (e.g., APPLE vs SAMSUNG vs XIAOMI)
- Cross-Asset Allocation: Evaluate performance across stocks, bonds, commodities, and currencies to guide portfolio rebalancing
- Risk-Adjusted Decisions: Use risk-adjusted performance to find investments with the best returns per unit of risk
Example Scenarios:
- Analyze whether tech stocks are outperforming the broader market by comparing XLK to SPY
- Evaluate which emerging market ETF (EEM vs VWO) has provided better risk-adjusted returns over the past year
HOW DOES IT WORK
The indicator calculates and visualizes performance from a user-defined starting point using two methodologies:
- Percentage Returns: Standard total return calculation showing percentage change from the start date
- Risk-Adjusted Returns: Cumulative returns divided by the volatility (standard deviation), providing insight into the efficiency of performance. An expanding window is used to calculate the volatility, ensuring accurate risk-adjusted comparisons throughout the analysis period.
HOW TO USE
- Setup Your Comparison: Enable up to 5 assets and input their symbols in the settings
- Set Analysis Period: When you first launch the indicator, select the start date by clicking on the price chart. The vertical start date line will appear. Drag it on the chart or manually input a specific date to change the start date.
- Choose Return Type: Select between percentage or risk-adjusted returns based on your analysis needs
- Interpret Results
- Use the real-time table for precise current values
SETTINGS
Assets 1-5: Toggle on/off and input symbols for comparison (stocks, ETFs, indices, forex, crypto, fundamental data, etc.)
Start Date: Set the initial point for return calculations (drag on chart or input manually)
Return Type: Choose between "Percentage" or "Risk-Adjusted" performance.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Our premium trading indicators: unicorn.trading
Join our Discord community: dsc.gg/unicom
Join our Discord community: dsc.gg/unicom
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Our premium trading indicators: unicorn.trading
Join our Discord community: dsc.gg/unicom
Join our Discord community: dsc.gg/unicom
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.